在同一个xpath中结合使用前后兄弟

时间:2016-12-13 17:03:23

标签: python selenium xpath

enter image description here

element = driver.find_elements_by_xpath('//td[following-sibling::td/div/a[@title="bet365"] and preceding-sibling::td/span[@class=" odds-wrap " and @eu="1.90"]]')
for ele in element:
    print(ele.text)

我需要获得<td> 161.5 </td>

的内容

但这不起作用..

我哪里错了?

0 个答案:

没有答案