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