How Python+selenium and Chrome fit together

Source: Internet
Author: User

Opening: Recently there are students in learning selenium, using Firefox has a problem, want to try Chrome, and its use of crome encountered a variety of problems ... The following articles are available for reference to people who encounter this problem

The whole article: How to solve it? Refer to the following:

  1. Introduction to the basic environment:

    python3.5 + selenium2.48 (or above) +chrome( version 65.0.3325.181 64-bit ), where Chrome has been updated to the latest version by April 2018 ...


  2. Download Chromedriver.exe

    The Chromedriver.exe file is a drive file that calls Chrome, so the version of the file must be compatible with the version of Chrome

    Chromedriver.exe as follows:http://chromedriver.storage.googleapis.com/index.html

    There are many versions of Chromedriver.exe, the version shown for Chrome ( version 65.0.3325.181) (2.37)

    Click 2.37 in the version.

3. Place the downloaded chromedriver.exe (2.37) on (copy or move) to Chrome's installation directory (the general Chrome installation path is as follows,C:\Program Files (x86) \google\chrome \application)

4. Set the system environment variable to add the path of chrome to the path (as in the steps).

5. Open the IDE (such as Pycharm) to write the code, and test it with the following code:

6. Run the 5th step of the code, it is very likely to error, given a similar to Chromedriver.exe ..... path and other words of the wrong message .... How to solve it?

    • Close all open chrome browsers and run again.

    • If you close the Chrome browser, not yet, will also give an error, then restart the computer, it should be OK

7. Follow the 6th step of the solution, you can call chrome by selenium ....

Concluding remarks: So far, you are done ..., hope to help you oh


How Python+selenium and Chrome fit together

Related Article

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.