cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Sat, 25 Apr 2009 14:35:30 -0600

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/.

-- 
--> Life begins at ovulation. Ladies should endeavor to get every young life fertilized. <--
-------------------------------------------------------------------
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