Python - Selenium in Ubuntu OSError: [Errno 20] Not a directory

后端 未结 5 1785
梦毁少年i
梦毁少年i 2020-12-03 11:01

After installing Selenium in Ubuntu and adding geckodriver to path I get this error when I run

from selenium import webdriver

driver = webdriver.Firefox()
         


        
5条回答
  •  不思量自难忘°
    2020-12-03 11:33

    Had the same problem. There were two ways to fix this for me:

    Add executable_path arg in webdriver:

    driver = webdriver.Firefox(executable_path='/path/to/geckodriver')
    

    And the second way its to add folder that contains geckodriver using export (only folder, not geckodriver):

    $ export PATH=$PATH:/path/to/
    

提交回复
热议问题