urllib: cannot open webpage which requires authentication

G

gmguyx

I tried using urllib.urlopen to open a personalized webpage
(my.yahoo.com) but it doesn't work:

print urllib.urlopen(http://my.yahoo.com).read()

Instead of returning my.yahoo.com, it returns a page asking me to log
in.

So then I tried urllib.urlencode:

data = urllib.urlencode({'action': 'https://login.yahoo.com/config/
login?', 'login': <mylogin>, 'passwd': <mypassword>})
print urllib.urlopen(http://my.yahoo.com, data).read()

However, this doesn't work either. Is there a way to do this? Thanks
in advance.
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top