ppage, 10
find_element_by_xpath("/html/body/div/div[2]/div/div/div/from/span/input")
find_element_by_xpath("/html/body/div/div[2]/div/div/div/from/span[2]/input")
find_element_by_xpath("/html/body/div/div[2]/div/div/div/form/span/input")
find_element_by_xpath("/html/body/div/div[2]/div/div/div/form/span[2]/input")
find_element_by_xpath("//span[@class='bg s_ipt_wt']")
find_element_by_xpath("//span[@class='s_ipt_wt']")
find_element_by_xpath("//a[text(), '']")
find_element_by_xpath("//a[text()='']")
find_element_by_xpath("//a[contains(text(), '')]")
find_element_by_xpath("//a[contains(text()='')]")
submit()
seearch.submit()
search_text.submit()
visibility_of_element_located``presence_of_element_located
visibility_of_element_located
presence_of_element_located
DOM4.12
w3school
from selenium import webdriver
from selenium.webdriver.support.select import Select
from time import sleep
driver = webdriver.Chrome()
driver.get('https://www.w3school.com.cn/tiy/t.asp?f=eg_html_select')
driver.set_page_load_timeout(2)
driver.set_script_timeout(2)
#
driver.switch_to.frame("iframeResult")
# select
sel = driver.find_element_by_tag_name("select")
# value="saab"
Select(sel).select_by_value('saab')
sleep(2)
# <option>Opel</option>
Select(sel).select_by_visible_text("Opel")
sleep(2)
#
Select(sel).select_by_index(3)
sleep(2)
driver.quit()
4.17 HTML5 ()
ChromeChromiumfirefoxJSH5
4.18
from time import sleep
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://www.jq22.com/yanshi4976")
driver.set_page_load_timeout(2)
driver.set_script_timeout(2)
sleep(2)
driver.switch_to.frame("iframe")
driver.find_element_by_id("appDate").click()
#
dwwos = driver.find_elements_by_class_name("dwwo")
year = dwwos[0]
month = dwwos[1]
day = dwwos[2]
#
action = webdriver.ActionChains(driver)
action.click_and_hold(year).move_by_offset(0, 100).perform()
action.reset_actions()
#
action2 = webdriver.ActionChains(driver)
action2.click_and_hold(month).move_by_offset(0, 150).perform()
action2.reset_actions()
#
action3 = webdriver.ActionChains(driver)
action3.click_and_hold(day).move_by_offset(0, 150).perform()
action3.reset_actions()
5.3
126
5.4.3 xml
config.xml
<platform>
<os>Windows</os>
<os>Linux</os>
<os>macOS</os>
<platform>
<platform>
<os>Windows</os>
<os>Linux</os>
<os>macOS</os>
</platform>