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

后端 未结 5 1772
梦毁少年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:16

    In addition to the answer by @Poloq, the simplest way would be keeping your geckodriver binary in a directory which is already in your PATH.

    mv geckodriver /usr/local/bin
    

    This way you can avoid additional settings/configurations in your project with the downside of having an additional step when deploying on different systems.

提交回复
热议问题