Configuration issues for Python3+firefox+geckodriver

Source: Internet
Author: User

When using selenium for Web automation testing, if the browser is using Firefox, there are some issues to be aware of in Selenium version selection and Firefox version selection and whether a separate Webdriver driver is required.

After installing selenium (pip3 install selenium), you will also need to install the driver Geckodriver. It is important to note that there is a version issue between them.

When you run the program with the following error, it may be the version issue.

Selenium.common.exceptions.WebDriverException:Message:connection refused

At first, I have been xshell operation, this will be an error. Then directly to the virtual machine terminal interface to directly operate, you can open Firefox, but there is no follow-up reflection, and then burst the above error. I query for half a day, first Firefox update to Mozilla Firefox 52.8.0, but still have problems, and finally looked at the Geckodriver version of Geckodriver 0.20.1, found that its version is too high (so not the newer the better). Finally, geckodriver 0.18.0 version: geckodriver-v0.18.0-linux64.tar.gz (: https://github.com/mozilla/geckodriver/releases) was downloaded.

Switch to the download path and enter the following command:

Tar-xvzf geckodriver*

    chmod +x geckodriver

sudo mv geckodriver/usr/local/bin/

At this point, the Geckodriver installation is configured successfully.

  

I did not find the corresponding relationship between Firefox and the version of the driver Geckodriver, which is only for reference.

Reference article:

77268924

78803230

Configuration issues for Python3+firefox+geckodriver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.