首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用于提取文本的XPath br

用于提取文本的XPath br
EN

Stack Overflow用户
提问于 2017-09-26 01:03:07
回答 1查看 322关注 0票数 0

代码语言:javascript
运行
复制
<div id="t_info" class="tab-pane fade active in tab">

<br><strong>Delivery</strong> <br>

<br><br><br><strong>Model Name</strong> : BP250

<br>

<br>Full HD up-scaling dramatically improves the resolution of any original content to Full HD. 
<br>
<br><strong>Barcode</strong> : 8806087225921
<br>
<br><strong>Product Type</strong> : Blu-ray Player<br>
<br>Blu-Ray Disc <br>External <br></div>

我需要xpath来捕获条形码值。条形码的位置因描述而异。

我已经尝试过//*text()='Barcode‘。但是我不能捕捉到它的价值。

EN

回答 1

Stack Overflow用户

发布于 2017-09-29 15:30:32

在您的示例中,您可以使用next XPath:

(//div[@id="t_info"]/text())[./preceding::strong[text()='Barcode']][1]

请注意,这是mauvais ton (不礼貌)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46410491

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档