J
joe_public34
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 =
"https://login.yahoo.com/config/logi...&.chkP=Y&.done=http://groups.yahoo.com&login="+yid+"&passwd="+pw+"&.persistent=y&.save=Sign
In"
temp = urllib.urlopen(url)
grp_list_source = temp.read()
Any thoughts or suggestions? Thanks.
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 =
"https://login.yahoo.com/config/logi...&.chkP=Y&.done=http://groups.yahoo.com&login="+yid+"&passwd="+pw+"&.persistent=y&.save=Sign
In"
temp = urllib.urlopen(url)
grp_list_source = temp.read()
Any thoughts or suggestions? Thanks.