我正在使用这个 xpath 表达式//*[@id='info_box']/p[contains(., 'Drafted')]
作为输出: http: //pastebin.com/kRmCadiw(原始输出与原始格式)
我想要的是获取最后一个之后的所有文本<br>
,所以我使用了:data(tokenize(//*[@id='info_box']/p[contains(., 'Drafted')], '\s*<br\s*/?>\s*')[last()])
但它仍然在<p>
(count(...)=1) 中给出全文,即使尝试使用简单的 '
' ......我不明白少了什么东西!
预期的输出是:Drafted by the San Francisco 49ers in the 2nd round (33rd overall) of the 2005 NFL Draft.