[Tutor] Web page capture

python python <python@inkedmn.net>
Tue, 20 Aug 2002 16:19:15 -0700


to actually download the html from a site, use urllib, like this:

url = "http://www.inkedmn.net/index.htm"
x = urllib.urlopen(url)
data = x.read()
x.close()

"data" should be the html from whatever URL you gave it...

SAJ> Is it possible to use URLLIB (or something else) to mimic the process of
SAJ> going to a URL, entering a userid and password and saving the resulting page
SAJ> to a file or as a field in a database? I have looked a bit at URLLIB but
SAJ> have not seen any way to enter the authentication stuff. Also how to
SAJ> actually save the html code itself to a file that can be called from a DB
SAJ> and rendered later.

SAJ> Thanks!!

SAJ> -Allen

SAJ> _______________________________________________
SAJ> Tutor maillist  -  Tutor@python.org
SAJ> http://mail.python.org/mailman/listinfo/tutor



-- 
Best regards,
 python                            mailto:python@inkedmn.net