ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
automatically dl pages which needs cookie
by Shagshag13 other posts by this author
Jul 1 2003 1:28AM messages near this date
Re: Good code patterns in Python | error message in Python...
hello,

i would like to automatically download html pages that need a cookie to be
set (in response of a form login) to be available. But i can't manage to do
it. Does anyone has a cut and paste example somewhere ? thanks for your
help.

i've tried ClientCookie but didn't manage to undestand how it work.
Also tried PyCurl and following code :

> >> import pycurl
> >> import urllib
> >> curl=pycurl.init()
> >> curl.setopt(pycurl.URL,mywebsite)
> >> dataread="login=aaa&password=bbb"
> >> curl.setopt(pycurl.POST,1)
> >> curl.setopt(pycurl.POSTFIELDS,dataread)
> >> curl.setopt(pycurl.COOKIEJAR,'my.txt')
> >> curl.perform()

but get an error that i don't undestand :

Traceback (most recent call last):
  File "<pyshell#21> ", line 1, in ?
    curl.perform()
error: (23, 'Failed writing body')

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved