Re: mismatch on script tags by getElementsByTagName and XPath

Boris Zbarsky <[email protected]> Tue, 19 Jul 2011 09:17:56 -0400
Newsgroups gmane.comp.mozilla.devel.embedding
Message-ID <[email protected]>
On 7/19/11 8:55 AM, legrass wrote:
> On that page,
> http://www.dixonvince.com/
>
> either using Firebug (on Firefox 3.6.17) or XPath I match 31 tags
> script.

After the page has loaded and the scripts have run, right?

> However, in my java code (xulrunner 1.9.2), if I retrieve the
> nsIDOMDocument and getElementsByTagName I get only 20 tags.

How are you retrieving it?

> Also, if I use the nsIDOMXPathEvaluator to evaluate the //script
> expression, the result is again 20 nodes.

Using what exact code, on which document?

> Finally, I tried to save the page with
> nsIWebBrowserPersist.saveDocument and on within the file there are
> indeed 20 occurrencies of script.

If you're saving the original html, then chances are some of those 
scripts add other script tags to the DOM.

-Boris