无法使用XPath从dd标签提取文本

时间:2019-06-23 22:42:18

标签: html xpath

我想从一个在线商店解析一些数据。为此,我正在使用Screaming Frog SEO Spider和XPath。我有4个查询。其中三个工作正常,但一个总是不返回任何内容。这是一段我想从中获取文本的HTML:

<dd class="price__regular">
                          162,
                          <small>
                            19
                          </small>
</dd>

我希望我的查询返回:162,19

我已经尝试了以下不返回任何内容的查询:

//dd[@class="price__regular"]/text()
translate(normalize-space(//dd[@class="price__regular"]), ' ', '')

此外,我也不知道是否值得注意,但是当您使用Chrome开发者工具检查标记时,标记内有双引号。

Screenshot of the piece of HTML in Dev Tools

0 个答案:

没有答案