in reply to javascript to html to perl

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.

Replies are listed 'Best First'.
Re^2: javascript to html to perl
by rduke15 (Beadle) on May 10, 2005 at 23:31 UTC

    Elinks sounds good, but for this project, I would like it to run in Win32.

    JRex allows embedding a browser into Java. I guess I'm after a mini-PRex, which would embed a mini (text-only) browser into Perl.

    Will I have to wait for Perl 6?... :-)

      I guess I'm after a mini-PRex, which would embed a mini (text-only) browser into Perl

      Or you could make one yourself. Should only take a loooooooooong time, and we all have time, right?

      It is important to note how EASY it is to actually write a mozilla based app. Please see the open licensed Rapid Application Development with Mozilla Book. You might find that Perl is not needed at this stage, but simply throwing together some mozilla components to do what you want.

      I would like it (ELinks) to run in Win32.

      Is cygwin out of the question? It may compile there. If so, then how about this:

      I know that Visual Basic is a curse word(s), but I believe in using the best tool for the job, so you could easily embed an (ie) browser in a vb app that could do what you need easily (as far as rendering/saving). It is fairly easy to use and fairly well documented.