using openurl to log into Yahoo services

joe_public34 joe_public34 at
Tue Nov 15 17:08:06 CET 2005

Hello all,

I'm trying to write a script to log into Yahoo! (mail, groups, etc),
but when I pass the full URL with all form elements via Python, I get
a resutling 400 - Bad Request page.  When I just plop the full URL
into a browser, it works perfectly. Is there something I need to
specify in python to submit the correct info (headers, user agent,
etc) to get the response I want? Here is the code I have that returns
the Bad Request:

import urllib, win32gui, win32clipboard, win32con, os, getpass, re
yid = raw_input("Yahoo! ID: ")
pw = getpass.getpass(prompt = 'Yahoo password: ')
url =
temp = urllib.urlopen(url)
grp_list_source =

Any thoughts or suggestions?  Thanks.

More information about the Python-list mailing list