Selenium conclusion,
Personal Understanding of selenium:
1. Using selenium to operate the browser is actually using the webdriver In the selenium framework to start the drivers of various browsers to perform operations on the browser. Run the following code to start the firefox browser DRIVER:
From selenium import webdriver
Brower = webdriver. Firefox ()
Therefore, the role of selenium is equivalent to simulating user operations on the browser (Click links, buttons, fill in forms, screenshots, control window size, install plug-ins, configure certificates, and so on ).
The reason why webdriver can manipulate the browser is that webdriver encapsulates the browser API. Because the browser API implementation methods produced by different manufacturers are not the same, webdriver is also divided into FirefoxDriver, ChromeDriver, iOSDriver and other drivers.
To call different browsers, in addition to installing and importing the webdriver module, we also need to download the driver corresponding to the browser.
2. webdriver can locate nodes,
Selenium Tutorial:
1. Mr. Nanke
I. Positioning related content:
1. Unable to locate the five situations and Solutions
2. iframe affects switchover and handling after Positioning
There are three main functions:
Brower. switch_to.frame (reference) is included in the referrence frame.
Brower. switch_to.parent_frame () is switched back to the parent frame.
Brower. swith_to.default_content () is switched back to the home page. If you want to switch between several parallel frames, you must add this sentence to the home page and switch to another iframe.
Ii. selenium related methods
1. Summary of common Python Selenium Methods
Iii. selenium packages
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By