cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Can CURL simulate the "Backspace" action in webrowsing?

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Sat, 25 Apr 2009 15:57:06 -0500

On Sat, Apr 25, 2009 at 3:35 PM, Doug McNutt <douglist_at_macnauchtan.com>wrote:

> At 14:46 -0500 4/25/09, Ralph Mitchell wrote:
> On Sat, Apr 25, 2009 at 2:28 PM, Hailu Meng <<mailto:hailumeng_at_gmail.com>
> hailumeng_at_gmail.com> wrote:
> When I use curl in php, I browse one link webpage and go to the next one.
> The simple way to go back is to OPTSET the previous link. But I am wondering
> whether there is other way to simply backspace the webpage.
>
> Curl doesn't maintain any kind of url history, so you'll have to do
> something external to curl. You could add new urls to an array, so
> backspacing is just a question of stepping backwards through the array.
>
> There is more to it than that. Curl doesn't, and shouldn't, provide any
> cashing of files. Thus any backspace operation would have to download the
> HTML and perhaps some of the image, JavaScript, and css files once again.
> There is no way curl could backspace to a partially filled out form the way
> a browser does.
>
> Php code could do its own cashing as it needs it and just refer to the
> previous "page" by opening the previously downloaded file and doing its
> thing. All that's needed is to let curl save the files locally rather than
> piping them into processing code and to provide a list of local paths,
> perhaps in /tmp/.
> --
>

I wasn't suggesting caching the saved html, just the url... I seen some
html that would wipe out real memory in just a couple of iterations,
including one page with around 750 hidden form variables. Trust me on this
- it was not nice to play with... :)

Ralph Mitchell

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-04-25