[WinError 2]FileNotFoundError in python Selenium webDriver

匆匆过客 提交于 2021-02-17 06:57:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!