Python+selenium Note (b): Configure Google +ie Environment

Source: Internet
Author: User
Tags seleniumhq

# Sometimes you may want to visit a foreign site to download materials or tools, there may be a variety of problems, such as Google's human computer verification can not display, the site can not open, etc., it is recommended to use a FQ software

Download the free version of the line, local tyrants please feel free. Install it directly after download.

Http://www.softpedia.com/get/Internet/Servers/Proxy-Servers/Lantern.shtml

(a) Set IE

(1) http://docs.seleniumhq.org/download/download iedriverserver. (Recommended download 32-bit, 64-bit drive execution Send_keys very slow, can be downloaded under the feeling)

(2) Unzip to any directory and add the path to the PATH variable

(3) In Internet Options, the following 4 are either protected mode enabled or not enabled.

(4) IE default zoom set to 100% (already 100% can ignore this step)

(5) Start the IDE (if it is started before setting iedriverserver, reboot required)

(6) Modify the code

Remove the following three lines from the previous article:

from selenium.webdriver.firefox.firefox_binary import firefoxbinary

Firefox = firefoxbinary (r "C:\Program Files (x86) \mozilla Firefox\firefox.exe")
Driver = Webdriver. Firefox (Firefox_binary=firefox)

Modified to:

Driver = Webdriver. Ie ()

(7) If it is IE11, also need to be in the registry (IE11 only, other versions not required)

Hkey_local_machine\software\wow6432node\microsoft\internet Explorer\main\featurecontrol\feature_bfcache

The new DWORD name is set to the Iexplore.exe value set to 0

After you've finished setting it up (if you can't find Feature_bfcache, create a new Item):

(8) Official documentation about IE11 browser settings (English is not good slightly pit, fortunately there are translation software, even guess with the mask)

Https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

(9) If it is win 10, also put the following settings 100%

(ten) when the IE start will pop up the following prompt, to see the literal meaning, this is not an error, just say Webdriver server startup.

(b) Setting up Google

(1) http://docs.seleniumhq.org/download/download Google Chrome Driver.

(2) Unzip to any directory and add the path to the PATH variable

(3) Start the IDE (if it is started before setting chromedriver, reboot required)

(4) Modify the code

Remove the following three lines from the previous article:

from selenium.webdriver.firefox.firefox_binary import firefoxbinary

Firefox = firefoxbinary (r "C:\Program Files (x86) \mozilla Firefox\firefox.exe")
Driver = Webdriver. Firefox (Firefox_binary=firefox)

Modified to:

Driver = Webdriver. Chrome ()

(iii) Personal views on automated testing

For example, the use of automatic harvester harvesting rice, in the appropriate environment (such as the plains), artificial can also complete the work, but the use of automatic harvester has 2 advantages 1, low cost. 2, high efficiency. But in unsuitable environments, such as some hilly environments in the south, automatic harvesters may not work at all, or are much more expensive to use than labor, or less efficient than labor. I think automated testing is the right thing to do to automate the right job. (Of course, unlike automatic harvesters and people, may be the performance of automation may be purely manual operation can not be achieved, such as: Concurrent users, large data volume testing, fatigue strength testing, etc.) here, actually said nothing, haha!

Python+selenium Note (b): Configure Google +ie Environment

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.