这是我的代码:
data = sel.xpath('//td[text()="Web Reporter"]/following::*/text()')
但它有虫子,谁能帮助我?
答案 0 :(得分:0)
尝试以下XPath
表达式:
//td[text()="Web Reporter"]/following-sibling::td/normalize-space(text()[1])
..获取"Allen Kong..."
//td[text()="Web Reporter"]/following-sibling::td/normalize-space(text()[2])
...代表"Bounty Tian..."
只需更改text()[N]
的索引即可获得所需的文字