[Tutor] saving webpage as webarchive

Benjamin Fishbein bfishbein79 at gmail.com
Mon Feb 29 23:32:39 EST 2016


This seems like it should be simple, but I can’t find any answer with the docs or google.
I’m on a Mac. OSX Yosemite 10.10.5
I want to save a webpage as a webarchive, and not just get the text.
I hope there’s a way to do it without saving all of the images separately.
And even if I do have to download them separately, then how would I combine everything into the HTM webarchive?

stuff = urllib.urlopen(url).read()
f = open(“file_name”, “w”)
f.write(stuff)
f.close()

The file_name is just the the text.
I realize that the solution to this will require “wb” due to the file type.
Other than that, I’m completely stuck.



More information about the Tutor mailing list