0

I have an Html String which I need to parse, but WITHOUT using HTMLAgilityPack.

Using XPath is quite simple, but how do I get it working using XPath?

7
  • or using WebBrowser control... Commented Jul 19, 2016 at 3:58
  • 1
    No, you cannot use XPath directly because Html is NOT Xml. Html allows tag without closing but Xml do not. Commented Jul 19, 2016 at 4:09
  • Also, what do you want to get from parsing html? If you just want to extract some variable, using regular expression and treating the html like string will work. Commented Jul 19, 2016 at 4:11
  • For WinForms there is System.Windows.Forms.WebBrowser which acts like a simple web browser (stackoverflow.com/a/56629). On ASP .NET, you need Regex class and creating HTML parser manually, since XPath usage usually combined with HtmlAgilityPack. Commented Jul 19, 2016 at 4:15
  • 3
    Is there a particular reason you don't want to use HtmlAgilityPack? What you're asking is akin to saying, "I want to drive a nail, without using a hammer." Use the best available tool for the job. Commented Jul 19, 2016 at 4:16

1 Answer 1

1

I'm not sure I understood your objection to HTML Agility Pack. I've just written a lightweight HTML parse and posted it on Github as HTML Monkey.

The initial version does not support XPath, but I'm still working on the project and looking for feedback and suggestions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.