WebDriverException: Message: invalid argument: can't kill an exited process error with Selenium GeckoDriver and Firefox in Google Colab on Ubuntu

后端 未结 1 1658
感动是毒
感动是毒 2021-01-24 16:54

In a previous post (enter link description here) the following code (by DebanjanB)

# install firefox, geckodriver, and selenium
!apt-get update
!pip install sel         


        
相关标签:
1条回答
  • 2021-01-24 17:32

    After all the discussion within the comments it seems you erred the command to download GeckoDriver and possibly some issues with downloading and/or installing Firefox.


    GeckoDriver

    The command to install geckodriver within ubuntu was error prone:

    !apt install firefox-geckodriver
    

    Here are the detailed steps:

    • Browse to the geckodriver releases page. Checkout the compatible version of GeckoDriver for your platform and download it as follows:

      wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
      
    • Extract the file with:

      tar -xvzf geckodriver*
      
    • Make it executable:

      chmod +x geckodriver
      
    • Add the driver to your PATH so other tools can find it:

      export PATH=$PATH:/path-to-extracted-file/.
      

    Reference: How to install geckodriver in Ubuntu?


    Firefox

    The latest version of Firefox is always available as a security updates in all supported releases of Ubuntu and a normal update will install it. You need to enable the security or you need to update the repositories (e. g. Software & Updates -> Updates). You need to enable the Security by default but better to check if the package manager doesn't updates Firefox by default.

    You can find the detailed steps in:

    • Firefox New Version - Community Help Wiki
    • https://askubuntu.com/questions/181607/how-to-install-thunderbird-15-on-ubuntu-12-04

    Reference: How do I install the latest stable version of Firefox?


    Update

    Selenium Client Driver page mentions:

    • Supported Python Versions:

      Python 2.7, 3.4+
      
    • But the list on selenium 3.141.0 page includes only:

      • Python :: 2.7
      • Python :: 3.4
      • Python :: 3.5
      • Python :: 3.6

    So possibly Python 3.7 is still not supported and you may have to downgrade to a relevant version.


    Outro

    SessionNotCreatedException: Message: Unable to create new service: ChromeDriverService with Selenium 3.14.0 and Python 3.7.3

    0 讨论(0)
提交回复
热议问题