Python selenium error when trying to launch firefox

前端 未结 8 1377
时光取名叫无心
时光取名叫无心 2020-12-01 16:35

I am getting an error when trying to open Firefox using Selenium in ipython notebook. I\'ve looked around and have found similar errors but nothing that exactly matches the

8条回答
  •  忘掉有多难
    2020-12-01 16:51

    Requirements:

    • Ubuntu 16.04 (i386)
    • Firefox 65.0.1.
    • python 3.8.5
    • geckodriver-v0.27.0-linux32.tar.gz

    This is what I do:

    • pip3 install selenium

    • Download geckodriver v0.27.0

    • Extract geckodriver

    • mv geckodriver /usr/local/bin/

    • export PATH=$PATH:/usr/local/bin/geckodriver

    • check Xauthority with command --> locate Xauthority

    • cd /home/your-user/Xauthority

    • chown root: .Xauthority

    • create python code:

      from selenium import webdriver

      browser = webdriver.Firefox() browser.get('http://localhost')

    • Run python script.

提交回复
热议问题