splinter operation ie browser

splinter is encapsulated in selenium, and many operations more convenient, but the default does not seem to directly operate ie, by modifying browser.py file, add ie.py file splinter \ driver \ webdriver, you can directly manipulate ie.

Environment: py3.7, win7, actual basic operation is no problem, click, find elements, select Switch frames and so on.

  • Modify browser.py file, you add two lines:

from splinter.driver.webdriver.ie import WebDriver as IeWebDriver #添加
from splinter.exceptions import DriverNotFoundError


_DRIVERS = {
"firefox": FirefoxWebDriver,
"remote": RemoteWebDriver,
"chrome": ChromeWebDriver,
"ie": IeWebDriver, # 添加
}

  • Increase ie.py next splinter \ driver \ webdriver, modified on the basis of chrome.py

github link: https: //github.com/chengair/SplinterforIe

Guess you like

Origin www.cnblogs.com/chengair/p/11224812.html