cURL / Mailing Lists / curl-library / Single Mail


Re: is it possible to curl browser rendered pages ?

From: Ralph Mitchell <>
Date: Tue, 8 Dec 2015 23:58:08 -0500

On Tue, Dec 8, 2015 at 6:05 PM, <> wrote:

> If I try to curl this page, then I get only a few lines of source code
> inside curl instead of the whole page with content.
> Are there special parameters needed to get the whole page source with curl
> ?
> this page as an example, does not load the whole source with curl:
Actually, curl does give you the whole source. If you bring that page up
in a browser, then right-click-view-source, you'll see the exact same html
source that curl hands you. What the browser does, which curl does not, is
it then searches that html source for html tags (e.g. img, src, stylesheet
href's, etc) and goes back to fetch those, possibly from multiple other
sites. The browser also interprets any incoming javascript, which can be
used to generate page source (e.g. document.write(), etc) as well. Lather,
rinse, repeat, until there are no more html tags to process.

Curl doesn't try to do the recursive html interpretation, it just fetches
whatever link targets you hand it.

Ralph Mitchell

List admin:
Received on 2015-12-09