driver.find_elements_by_css_selector(
"#blog_nav_contact")#iddriver.find_elements_by_css_selector(".menu")#classdriver.find_elements_by_css_selector("a")#标签driver.find_elements_by_css_selector("[rel='nofollow']")#其他属性driver.find_elements_by_css_selector("type='text'")#type属性#标签与属性的组合driver.find_elements_by_css_selector("input:contains('kw')")driver.find_elements_by_css_selector("input.s_ipt")#标签和class属性driver.find_elements_by_css_selector("input#kw")#标签和id属性driver.find_elements_by_css_selector("input[id='kw']")#标签和其他属性driver.find_elements_by_css_selector("form#form>span>input")driver.find_elements_by_css_selector("form.fm>span>input")#<select id='na' name='me'>#<option selected="" value="北京">北京</option>#<option value="上海">上海</option>#<option value="天津">天津</option>#</select>driver.find_elements_by_css_selector("select#na>option:nth-child(1)")#选择北京driver.find_elements_by_css_selector("select#na>option:nth-child(2)")#选择上海driver.find_elements_by_css_selector("select#na>option:nth-child(3)")#选择天津#逻辑运算driver.find_elements_by_css_selector("input[id='kw'][name='wd']")
转载于:https://www.cnblogs.com/hhm8hhm/p/7214812.html
转载请注明原文地址: https://win8.8miu.com/read-1543840.html