Python+selenium+eclipse performing Web automation (ii) launching the browser

Source: Internet
Author: User

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

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.