<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‘。但是我不能捕捉到它的价值。
发布于 2017-09-29 15:30:32
在您的示例中,您可以使用next XPath:
(//div[@id="t_info"]/text())[./preceding::strong[text()='Barcode']][1]
请注意,这是mauvais ton (不礼貌)
https://stackoverflow.com/questions/46410491
复制相似问题