driver.find_element_by_xpath() 带参数时的写法

假设要定位如下所示的 Elements,且文本 “1234567890” 对应参数 cluster_name:

<td  class="xxxx-body">1234567890</td>

具体定位方式如下:

driver.find_element_by_xpath("//td[contains(text(),'%s')]" % cluster_name)

猜你喜欢

转载自www.cnblogs.com/jjstrip/p/11764728.html