Code
From Wizardsforge
(Difference between revisions)
Revision as of 00:45, 13 October 2006
Python code to get a set of pages:
import urllib
def write_page(url, filename): sock = urllib.urlopen(url) htmlSource = sock.read() sock.close()
save = open(filename, 'w') save.write(htmlSource) save.close()
def write_page_list(list, path): index = open(path+'/index.txt', 'w') for x in range(0, len(list)): write_page(list[x], path+'/'+str(x)+'.html') index.write(str(x)+':'+list[x]+'\
')
index.close()