在下方,我尝试在ReportUser-7-0机械手强标签中找到电子邮件地址
<tr>
<td>
<span class="tablesaw-cell-content report-user">
<strong>ReportUser-7-0 Robot</strong>
<br/>
[email protected]
<br/>
SubInvestigator-2849
</span>
</td>
</tr>
但是,xpath
descendant::strong[contains(text(),'ReportUser-7-0 Robot')] and contains(text(),'[email protected]')
找不到。
我猜是因为它不驻留在强标签中-由于电子邮件不驻留在任何特定标签中,因此挖掘电子邮件的正确方法是什么?我尝试了跨度但没有喜悦。
最佳答案
尝试在XPath
以下获取电子邮件值"[email protected]"
//strong[text()="ReportUser-7-0 Robot"]/following::text()[2]
关于xml - 在xpath中挖出电子邮件地址,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43913157/