softtouch 9 Posted December 29, 2024 Does anybody know of an open source html parser which support xpath expressions and can parse the html content from a string or stream? I tried the HtmlParserEx from https://github.com/radprogrammer/htmlparser but it only understand simple xpath expressions like //*[@class="description"] but does not work properly using //*[@class="description" and contains(text(),"whatever")] (returning wrong data) Share this post Link to post
Remy Lebeau 1458 Posted December 29, 2024 XPath parses only XML. You can't use XPath to parse plain HTML. It can parse XHTML, which is HTML using XML syntax. Share this post Link to post