[2.5] Script to POST to web page with cookies?

G

Gilles Ganault

Hello

I need to write a script to automate fetching data from a web site:
1. using the POST method, log on, with login/password saved as cookies
2. download page and extract relevent information using regexes
3. log off
4. wait for a random number of minutes, and GOTO 1

I'm a bit confused with how to get POST and cookies in the same
script:
- urllib vs urllib2 vs httplib?
- "ClientCookie.urlopen("www") behaves identically to urllib2.urlopen,
except that it deals with cookies automatically"

Has anyone some working code that I could borrow (er... steal) to do
this?

Thank you.
 
7

7stud

Hello

I need to write a script to automate fetching data from a web site:
1. using the POST method, log on, with login/password saved as cookies
2. download page and extract relevent information using regexes
3. log off
4. wait for a random number of minutes, and GOTO 1

I'm a bit confused with how to get POST and cookies in the same
script:
- urllib vs urllib2 vs httplib?
- "ClientCookie.urlopen("www") behaves identically to urllib2.urlopen,
except that it deals with cookies automatically"

Has anyone some working code that I could borrow (er... steal) to do
this?

Thank you.

Also, see here:

http://www.voidspace.org.uk/python/articles/cookielib.shtml
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top