Recentemente ho installato PhantomJS e incontrato questo errore nel mio primo run:.Impossibile caricare Atom '' find_element"
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.PhantomJS()
driver.get("http://www.google.com")
driver.find_element_by_id('some_element').send_keys('something' + Keys.RETURN)
Questo codice funziona con Firefox WebDriver, ma non funziona con PhantomJS ricevo il seguente errore :
Traceback (most recent call last):
File "<PATHTOFILE>", line 20, in <module>
driver.find_element_by_id('lst-ib').send_keys('something' + Keys.RETURN)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 266, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 744, in find_element
{'using': by, 'value': value})['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 165, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: Error - Unable to load Atom 'find_element' from file ':/ghostdriver/./third_party/webdriver-atoms/find_element.js'
Avete fatto che il file phantomjs.exe, o qualunque file sia, è nel tuo PATH Python? In tal caso, il processo phantomjs è attivo? – DuckPuncher