如何在 nokogiri xpath 中使用正则表达式
how to use regex in nokogiri xpath
div class="ydpbfddd73dsignature" >......
如何使用 xpath 获取此标记后的任何文本?
我试过这样做
nokogiri_html=Nokogiri::HTML html
nokogiri_html.xpath('//div[@class="/.*signature/"]')
但是不行。
你可以在XPath下面申请:
//div[substring(@class, string-length(@class) - 8)="signature"]
表示 return div 节点 "signature"
作为 class name[=12= 的最后 9 个字符]
div class="ydpbfddd73dsignature" >......
如何使用 xpath 获取此标记后的任何文本?
我试过这样做
nokogiri_html=Nokogiri::HTML html
nokogiri_html.xpath('//div[@class="/.*signature/"]')
但是不行。
你可以在XPath下面申请:
//div[substring(@class, string-length(@class) - 8)="signature"]
表示 return div 节点 "signature"
作为 class name[=12= 的最后 9 个字符]