I have a widget that needs to get HTML source code form a variety of websites. LWP:: is fine for getting most Web pages. It does not however get the 'real' HTML source for pages like:

<script>window.location = 'http://somewhere.else'</script>

What I want to do is get the terminal HTML source that represents the page(s) that a real user gets to see finally rendered in their browser once the javascript redirection dust settles as it were.

While parsing javascript like the simple example above is of course easy, there are an infinite number of variations on this and you need a full blown Javascript/DOM engine. Seeing these are already written for the Major Browsers there seems no point in not just hooking them.

For IE there is OLE or SAMIE but this constrains you to use Windows for the OS which is what we are currently doing.

Is there an equivalent for Mozilla so I can run this widget on *nix?


In reply to Getting HTML Source Code where Javascript Redirects Foil LWP by doc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.