1. Selection of individual elements
find_element_by_id find elements by Tag property ID
Find_element_by_name to find an element by using the Tag property name
Find_element_by_xpath finding elements by tag XPath path
Find_element_by_link_text find elements through element text links in tags
Find_element_by_partial_link_text
Find_element_by_tag_name by tag name Tag name find element
Find_element_by_class_name finding elements by the class property of a tag
Find_element_by_css_selector finding elements through CSS styles
2. Selection of multiple elements
Find_elements_by_name
Find_elements_by_xpath
Find_elements_by_link_text
Find_elements_by_partial_link_text
Find_elements_by_tag_name
Find_elements_by_class_name
Find_elements_by_css_selector
3. Return cookies in the current session
Driver.get_cookies ()
4. intercept the current page
Driver.get_screenshot_as_file (R "c:desktop\test.jpg")
driver.save_screenshot(‘screenshot.png‘)
5. Input Value Method
driver.find_element_by_id ("kw"). Send_keys (' admin ') Note: If the Chinese need to add u driver.find_element_by_id ("kw" ). Send_keys (u ' Youth ')
6. Simulate click action after getting element
driver.find_element_by_id ("kw"). Click ()
6. Close the browser
Driver.close ()
Driver.quit () Close the browser and eject the driver
The selection of elements of the Python crawler's selenium