Using Python 2.1 to download asp www pages

zugz zugz.public at DELETEMEcwcom.net
Mon Jan 7 12:52:56 EST 2002


"Hans Nowak" <wurmy at earthlink.net> wrote in message
news:3C38C41D.F7CD81C4 at earthlink.net...

> This is what I get in an interactive session:
>
> >>> u =
urllib.urlopen("http://boards.gamers.com/messages/overview.asp?name=panther_
xl&page=2")
> >>> u.url
>
'http://boards.gamers.com/user/profiling/login/cookieread.asp?action=read&de
st_url=%2Fmessages%2Foverview%2Easp%3Fname%3Dpanther%5Fxl%26page%3D2'
>
> If u's .url attribute is different from the URL you told it to
> connect to, then this usually means a redirection. In this
> case, it seems that you have to log in, and/or that a cookie
> is expected. urllib.urlopen is not a mini-browser, and thus
> does not implicitly use cookies.

Hi,

Thanks for the reply.

I did get about this far myself (it's always tricky to judge how much to
post about what you tried and failed with). Your point about it not being a
mini browser is possibly the key.

There is a cookie involved. You do not need to login but if you are a member
it logs you in and enables editing of messages etc.

> You may want to look into the Cookie.py module (in the standard
> library). Not sure if that will help you here though, because
> I've never used it myself. :-/

Thanks,
I'll give it a look when I get home.

Regards,
Zugz.





More information about the Python-list mailing list