问题
I'm started to learn python Selenium. I just downloaded by pip pip install python-selenium
and started to write first lines and at this moment appeares
>>> from selenium import webdriver
>>> from selenium.webdriver.common.keys import Keys
>>> driver = webdriver.Firefox()
[WinError2] FileNotFoundError...
...
Then I tried it with Chrome but appeares the same thing. Who can solve this problem?
回答1:
You do following things and check whether it works. Upgrade python bindings using
pip install -U selenium
for chrome download the latest chrome driver "ChromeDriver 2.45" and write the code
from selenium import webdriver
driver=webdriver.Chrome("Path of the Chromedriver" + "chromedriver.exe" )
来源:https://stackoverflow.com/questions/54251288/winerror-2filenotfounderror-in-python-selenium-webdriver