Unable to load Atom ''find_element"

前端 未结 3 352
陌清茗
陌清茗 2021-02-01 02:18

I have recently installed PhantomJS and encountered this error on my first run:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

d         


        
相关标签:
3条回答
  • 2021-02-01 02:25

    These are the precise steps that worked for me:

    1. Purge old phantomjs
      apt purge phantomjs

    2. Wget the latest phantomjs (as per http://phantomjs.org/download.html)
      wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

    3. Untar it
      tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2

    4. Moved the phantomjs executable to /usr/bin/ (may need sudo)
      cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/

    0 讨论(0)
  • 2021-02-01 02:36

    For me it start to work after

    apt install nodejs-legacy # just an alias node/nodejs to make npm install work
    apt purge phantomjs       # optionaly
    npm install -g phantomjs  # most important part because apt installation failed for me
    
    0 讨论(0)
  • 2021-02-01 02:39

    The reason is that I used apt-get install Phantomjs to install it, but it seems that it is a not full-functional Phantomjs version installed by apt-get. So, download manually from the Phantomjs website and add the containing direction to the PATH environment variable.

    0 讨论(0)
提交回复
热议问题