Path positioning of css_selector and xpath

The principle of css_selector path positioning, first locate the first one, and then add one to indicate the second one, css_selector is as follows
brower.find_element_by_css_selector('table>tbody#plan_list>tr+tr>td>input[type="checkbox"]').click()
Written as by_xpath as follows
brower.find_element_by_xpath('//table/tbody[@id="plan_list"]/tr[2]/td/input[type="checkbox"]').click()
 
css_selector is as follows
brower.find_element_by_css_selector('table>tbody#plan_list>tr+tr+tr>td>input[type="checkbox"]').click()
Written as by_xpath as follows
brower.find_element_by_xpath('//table/tbody[@id="plan_list"]/tr[3]/td/input[type="checkbox"]').click()
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325022861&siteId=291194637