Form Post Trouble Using urllib

bromden bromden at gazeta.pl.no.spam
Wed Oct 15 04:46:43 EDT 2003


first, the url you should request is
http://www.usps.com/zip4/zip4_response.jsp
it is the "action" attribute of the form submitted as you can see when
you view source of http://www.usps.com/zip4,

then, when you trace javascript executed on the form submission,
you'll notice that the field "address" is filled with the result of
concatenation of "address1" and " " and "address2"

update these two bits and it'll work as you intended

 >     url = "http://www.usps.com/zip4/zip4_response.jsp"
...
 >         'address': '1600 pennsylvania',
 >         'address1': '',
 >         'address2': '',
...

-- 
bromden[at]gazeta.pl





More information about the Python-list mailing list