WebDriverException: Message: invalid argument: can't kill an exited process with GeckoDriver, Selenium and Python on RaspberryPi3

后端 未结 11 843
一整个雨季
一整个雨季 2020-11-22 11:04

Server: Raspberry Pi 3
OS: Dietpi - version 159
Geckodriver version: 0.22 for arm
Firefox version: 52.9.0
Python version: 3.5
Selenium version: 3.14.1 <

11条回答
  •  日久生厌
    2020-11-22 11:17

    As Nico and jay have stated you need to check the logs to see the details of the error. As you might use different systems, you can specify the path where the log is stored (i.e. "/tmp/geckodriver.log").

    from selenium import webdriver
    firefox_options = webdriver.firefox.webdriver.Options()
    driver = webdriver.Firefox(log_path="/tmp/geckodriver.log", 
                               options=firefox_options)
    

    In my particular case, what the log said was:

    Error: no DISPLAY environment variable specified

    That was resolved adding in the options the headless mode before starting the driver. With the line:

    firefox_options.set_headless()
    

提交回复
热议问题