Jul-13-2018, 07:34 AM
I can save multiple web pages with using these codes; however, I cant see a proper website view after saving them as html. For example, the texts in table are slipped and images can't be seen. I need to download entire pages just as we do save as in any web browser so that I can see a proper view.
1 2 3 4 5 6 7 8 9 10 11 |
import urllib.request for i in range ( 1 , 5 ): print ( ' --> ID:' , i) newurl = url + str (i) f = open ( str (i) + '.html' , 'w' ) page = urllib.request.urlopen(newurl) pagetext = str (page.read()) f.write(pagetext) f.close() |