Instead of saving text files i need as html

Shani Shani718 at
Thu Jun 8 16:38:19 CEST 2006

I have the following code which takes a list of urls
"", without the quotes ofcourse, and then saves there
source code as a text file. I wan to alter the code so that for the
list of URLs an html file is saved.

import urllib
urlfile = open(r'c:\temp\url.txt', 'r')
for lines in urlfile:
        outfilename = lines.replace('/', '-')
        urllib.urlretrieve(lines.strip('/n'), 'c:\\temp\\' \
        + outfilename.strip('\n')[7:] + '.txt')

More information about the Python-list mailing list