cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: use curl with cookies assignt by javascript...

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 8 Apr 2003 10:03:50 +0200 (CEST)

On Tue, 8 Apr 2003, Jill Tam wrote:

> i try to use both curl -b and curl -c to write cookies files, but i still
> cant open the url i want. i think the reason is because some of cookies in
> that url is written by a javascript. So is there any way i can use curl to
> obtain cookies file from website that use javascript to assign cookies?

curl does not know how to run javascript code, so you need to work around
that fact somehow.

What I've ended up doing multiple times, is to really check out the
javascript that sets the cookie (I've found sites that verifies that that
javascript "works" by using it to set a cookie and then check that the
cookie arrives) and then emulate its behavior.

I usually use perl to scan the received data and then I can extract the
cookie contents from the javascript file and set it "manually".

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-04-08