3 ms·
Related question: is there a "gold standard" parsing library for html, like webkit is becoming the standard DOM engine?
by DanielBMarkham 16y ago
Related question: is there a "gold standard" parsing library for html, like webkit is becoming the standard DOM engine?
- samdk 16y agoI don't know about a parsing library, but the HTML5 spec defines how parsers for it should behave, so at least at some point in the not-too-distant future, it shouldn't matter too much. I think Chrome/Safari already implement it (or at least are fairly close) and Firefox has its own implementation coming in Firefox 4. If you're looking for one to do HTML scraping, I think it really depends on the language you're using, and I don't think there's a single gold standard.
- lazugod 16y agoThere's Amaya (http://www.w3.org/Amaya/ http://www.w3.org/Amaya/), the browser that the W3C uses for experimentation. I'm confused by your question, though; are you implying that webkit is a standard DOM engine, or asking? Webkit isn't a standard, it's merely broadly used. And a standard DOM parser and a standard HTML parser would be one and the same.
- DanielBMarkham 16y agoI'm playing around with scraping, and one of the first things to do is parse the html. I was just wondering if there was a standard way to parse it. Right now I'm using HtmlAgilityPack, but I'm not adverse to hooking into a third-party dll (or writing my own parser) if necessary. Just wondering what was out there. As an example, today I ran into a website with opening <p> tags but no closing </p> tags Wreaks havoc with the DOM on the parser I'm using. Before I start hosing around with that I was just trying to make sure I wasn't re-inventing the wheel.
- bricestacey 16y agoAre you asking for something like Hpricot (http://hpricot.com/ http://hpricot.com/) or Nokogiri (http://nokogiri.org/ http://nokogiri.org/)? They will let you parse and search HTML and XML using CSS or XPath selectors.
- adatta02 16y agoXerces isn't bad http://xerces.apache.org/xerces-j/ http://xerces.apache.org/xerces-j/