No such file or directory: 'geckodriver' for a Python simple Selenium application

前端 未结 2 1511
北荒
北荒 2021-02-11 12:31

I\'m running a simple example of selenium on Linux:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
         


        
2条回答
  •  死守一世寂寞
    2021-02-11 13:12

    Selenium requires geckodriver to interface with Firefox. Here's how to install geckodriver:

    1. Download geckodriver from https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz (or if you need the 32 bit version, go to https://github.com/mozilla/geckodriver/releases to see more download options)
    2. Extract the file into your Downloads folder
    3. Open a console and run sudo mv ~/Downloads/geckodriver /usr/bin

提交回复
热议问题