Jump to content
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×