Posting to https
dpawlows
dpawlows at umich.edu
Tue Mar 23 18:13:36 EDT 2010
I am trying to obtain data on a https site, but everytime I try to
access the data that is behind the logon screen, I get the logon page
instead. I was able to successfully do a test problem:
import sys, urllib2, urllib
zipcode = "48103"
url = 'http://www.wunderground.com/cgi-bin/findweather/getForecast'
data = urllib.urlencode([('query', zipcode)])
req = urllib2.Request(url)
fd = urllib2.urlopen(req, data)
while 1:
data = fd.read(1024)
if not len(data):
break
sys.stdout.write(data)
which performed as I expected.
However, for the url 'https://secure.umcu.org/cgi-bin/mcw000.cgi?MCWSTART'
with data = ... {'HBUSERNAME':username,'PASSWORD':password}
I was sent just the logon screen. Am I missing something important
that has to do with interaction with javascript, https, or cgi, or
something completely different?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100323/c5ff6eac/attachment.html>
More information about the Python-list
mailing list