cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: page renedered by javascript

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Thu, 7 Jan 2010 20:45:08 -0500

On Thu, Jan 7, 2010 at 12:22 PM, Conoscenza Silente <
abruzzoforteegentile_at_gmail.com> wrote:

> Hi
> I would like to download a web page that is rendered by a javascript
> calling some server application somewhere.
> The web page, once rendered, contains a big simple table that I need to
> parse.
> I try to used curl with the URL I have but I cannot download the table;
> what I download is only the web page calling the javascript itself.
> Do you know if I have to use some sepcific options in order to do that?
>

You could extract the url to download the javascript, but curl doesn't have
a built-in method to process the javascript to get the rendered page. You
might be able to pass the javascript through an external javascript
interpreter, but there's a high probability of failure if the javascript
refers to page elements. You simply won't have the correct environment to
properly evaluate the javascript.

On the other hand, if you can reduce the javascript-generated page to a few
simple elements, it might still be possible to proceed further. You'll
probably need to inspect the javascript and work out by hand exactly what it
produces to be able to continue.

Ralph Mitchell

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-08