Xpath 从表单中提取文本 [英] Xpath extract text from a form

查看:39
本文介绍了Xpath 从表单中提取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<td nowrap>Source name</td>
<td style="text-align: justify">Fresh postmortem eye<br>

我需要提取表单上来源名称"之后的文本新鲜验尸".我试过这个:

I need to extract the text "Fresh postmortem eye" that comes after "Source name" on a form. I tried this:

//Source name/following-sibling::text()[1]

并没有得到任何东西.我正在开发一个网络爬虫.

and didn't get anything. I'm hacking together a webscraper.

推荐答案

试试这个:

//td[.="Source name"]/following-sibling::td[1]/text()

这篇关于Xpath 从表单中提取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆