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()