xidel

How to get xpath of invalid html?

萝らか妹 提交于 2019-12-11 18:32:25
问题 I am trying to extract xpath from html using xidel and recently encountered invalid html i use firefox to get the xpath, but firefox automatically adds missing tags so the xpath doesent match can i stop firefox, or can you suggest a way to deal with this? also is there someway of a reverse xpath? to get the xpath of some text? 回答1: As Jim Garrison already mentioned: XPath is not going to work if your html is invalid. To answer to your second question: You can get the XPath of some text easily