
“Inspect element” is not the same as “View source” - joshuacc
http://www.456bereastreet.com/archive/201009/inspect_element_is_not_the_same_as_view_source/
======
pavel_lishin
> When you choose “Inspect element” or otherwise bring up one your browser’s
> DOM inspector, what you’re looking at is the document tree after the browser
> has applied its error correction and after any JavaScripts have manipulated
> the DOM.

Isn't this fairly obvious?

Being unable to inspect elements after you've fiddled with them via javascript
would eliminate about 99% of the usefuless...

~~~
martey
I think the article was making the point that someone debugging a HTML page
would do well to look at both "Inspect Element" and "View Source," as there
might be errors only visible in the latter.

For example, a few weeks ago, I was testing a website. It worked fine in
Firefox, Chrome, and Safari, but broke horribly in Internet Explorer. A look
at the source made me realize that a syntax error in my templates was causing
the first few lines of the source (including <html><head>, etc.) to render.
The other browsers all ignored this.

~~~
mikeryan
I can't, of course, speak to your issue directly but the chrome/webkit
debugger usually shows these errors in the console?

------
DanielBMarkham
Related question: is there a "gold standard" parsing library for html, like
webkit is becoming the standard DOM engine?

~~~
lazugod
There's 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
I'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.

