download web page with python

Ng Pheng Siong ngps at madcap.dyn.ml.org
Thu Dec 16 10:20:11 EST 1999


According to Ng Pheng Siong <ngps at post1.com>:
> import urllib
> 
> url = "http://www.symantec.com/avcenter/cgi-bin/navsarc.cgi"
> post_data = urllib.urlencode({"PROD":"N95", "LANG":"US"})
> url_obj = urlopen(url, post_data)

Ouch! I meant the following, of course:

url_obj = urllib.urlopen(url, post_data)

> print url_obj.readlines()


-- 
Ng Pheng Siong <ngps at post1.com> * http://www.post1.com/home/ngps




More information about the Python-list mailing list