First, browser compatibility
Currently supported browsers for Selenium 2.0
As you can see from the Selenium __init__ file, the selenium version I'm currently using is 2.53.2
Viewing the __init__ file from the Selenium webdriver module, you can see the following code:
From. Firefox.webdriver Import Webdriver as Firefox
From. Firefox.firefox_profile Import Firefoxprofile
From. Chrome.webdriver Import Webdriver as Chrome
From. Chrome.options Import options as Chromeoptions
From. Ie.webdriver Import webdriver as IE
From. Edge.webdriver Import Webdriver as Edge
From. Opera.webdriver Import Webdriver as Opera
From. Safari.webdriver Import Webdriver as Safari
From. Blackberry.webdriver Import Webdriver as BlackBerry
From. Phantomjs.webdriver Import Webdriver as Phantomjs
From. Android.webdriver Import Webdriver as Android
From. Remote.webdriver Import webdriver as remote
The current version of Webdriver supports browsers such as Firefox, Chrome, IE, Edge, Opera, Safari, BlackBerry, Phantomjs, Android, and remote. However, the personal measurement Selenium 2.0 does not support the Firefox browser 43.X or above version (prompt "Stop responding" after startup), does not support IE11 or above, Chrome does not support more than 12.X version, other browsers have not been measured.
Second, launch the browser
#使用一下语句导入selenium的webdriver模块
From selenium import Webdriver
The following is the example of Firefox
#设置配置文件路径
Profile = Webdriver. Firefoxprofile (r "C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\r1ub4zn3.default")
Where the red part is based on the personal Computer Configuration modification
#使用配置文件
Browser = Webdriver. Firefox (Profile)
Browser.get (URL)
Open URL Connection
Python+selenium+eclipse performing Web automation (ii) launching the browser