I am assuming that you want the data after the javascript writes have been performed (not just the raw html doc without the writes performed). If so, here is a trick:

ELinks is a text only browser with some javascript support. You might want to script it to download and save the rendered page, then run your script across that.

You might consider the same thing with mozilla. Allow it to perform all of the javascript writes, and then scrape that. With a little poking around you will find that mozilla can be pretty easy to work with(look at JRex as a possible start). The idea here is: let a javascript rendering engine perform all the writes, then scrape the results.


In reply to Re: javascript to html to perl by scmason
in thread javascript to html to perl by rduke15

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.