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

前端 未结 3 661
清歌不尽
清歌不尽 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()
         


        
3条回答
  •  时光说笑
    2021-02-11 13:18

    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

提交回复
热议问题