繁体   English   中英

我需要帮助来获取 header 内 p 标签下的值的 xpath

[英]I need help to get the xpath of the value which is under p tag inside the header

你能帮我提取里面的成分表吗

标签。 我尝试了一些东西并且能够得到直到 header - 成分。 我期待提取价值。 我尝试的路径 - //DIV[@id="important-information"]//h4[text()='Ingredients:']/text()

在此处输入图像描述

您可以使用此 xpath 来定位图像中突出显示的第二个 p 标签元素。 xpath 下面可用于自动化,因为它将返回 web 元素-

//div[@id="important-information”]//div[2]//p[2]

如果您直接想从 xpath 获取文本,请使用以下 xpath-

//div[@id="important-information”]//div[2]//p[2]/text()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM