作者:百变精灵621126 | 来源:互联网 | 2022-11-24 18:30
这是使用兄弟姐妹后的代码我无法点击复选框.它出什么问题了?
码:
checkbox1 = driver.find_element_by_xpath("td/nobr/a[text()='192.168.50.120']/../preceding-sibling::td/input[@class='checkbox']")
1> eLRuLL..:
你没有得到正确的元素,你想要得到td
.正确的xpath应该是:
//td[nobr/a[text()='192.168.50.120']]/preceding-sibling::td/input[@class='checkbox']