Jump to content
Registration disabled at the moment Read more... ×
softtouch

Open source html parser supporting xpath?

Recommended Posts

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×