[英]I need help to get the xpath of the value which is under p tag inside the header
Can you please help me in extracting ingredient list inside the你能帮我提取里面的成分表吗
tag.标签。 I tried few things and was able to get till header - Ingredients.
我尝试了一些东西并且能够得到直到 header - 成分。 I am look to extract the value.
我期待提取价值。 Path i tried - //DIV[@id="important-information"]//h4[text()='Ingredients:']/text()
我尝试的路径 - //DIV[@id="important-information"]//h4[text()='Ingredients:']/text()
You can use this xpath to locate the 2nd p tag element highlighted in the image.您可以使用此 xpath 来定位图像中突出显示的第二个 p 标签元素。 Below xpath can be used in automation as it will return the web element-
xpath 下面可用于自动化,因为它将返回 web 元素-
//div[@id="important-information”]//div[2]//p[2]
And if you directly want to get the text from xpath then use below xpath-如果您直接想从 xpath 获取文本,请使用以下 xpath-
//div[@id="important-information”]//div[2]//p[2]/text()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.