jjstrip

导航

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)

posted on 2019-10-30 14:30  jjstrip  阅读(6443)  评论(0编辑  收藏  举报