1. Use the webdriver module in selenium2 to operate the browser (environment: py3.6, browser: firefox35.0)
① Commonly used element positioning
Element name |
webdriver API |
id |
find_element_by_id() |
name |
find_element_by_name() |
class_name |
find_element_by_class_name() |
tag_name |
find_element_by_tag_name() |
link_text |
find_element_by_link_text() |
partial_link_text |
find_element_by_partial_link_text() |
xpath |
find_element_by_xpath() |
css_selector |
find_element_by_css_selector() |
② Commonly used operation methods of elements
Method name |
description |
clear |
Clear the content in the input box |
submit |
submit Form |
send_keys |
Simulate the user's input operation and input data into the input box |
click |
Simulate user click operation |
|
|