"Python" with Python open ie, Google and other browser errors and solutions

Source: Internet
Author: User

Take IE browser as an example :

When the Python shell enters the following code:

# Coding=utf-8  from Import webdriver>>> driver = webdriver. Ie ()

Report the following error:

Later on-line query learned, because Python did not install the corresponding browser launcher, (can refer to the "original", as well as the great God to share the download plugin "address"), note that when downloading IE has 32-bit \ 64-bit.

Similarly, if you want to start IE or Google Browser, you also need to download the relevant plug-ins, placed in the Python installation path (C:\Python27, and Python.exe in the same level directory), according to their own path.

1. How to start IE

 from Import Webdriver   = Webdriver. Ie ()  Driver.maximize_window ()  . driver.implicitly_wait (8)  driver.get (" https://www.baidu.com " )  driver.quit ()

2. How to start Chrome

 from Import Webdriver   = Webdriver. Chrome ()  Driver.maximize_window ()  #  Maximize browser   #  Set implicit time Waits     driver.get ("https://www.baidu.com")  

Go
Note: An error may occur

Exception:Message:Unexpected Error Launching Internet Explorer. Protected Mode settings is not the same for all zones. Enable Protected Mode must is set to the same value (enabled or disabled) for all zones. Workaround: Internet Options, security, Internet sites, local intrant, Trusted sites Three places of the security interface are set the same level, such as all settings; Run the code again to open Baidu with IE. 

Summary: At present, due to the instability and speed of IE, it is recommended to use Firefox or Google browser to test and debug automation scripts.

Correct result diagram:

"Python" with Python open ie, Google and other browser errors and solutions

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.