How to add the output of each html page into multiple files in python? : I created a code that would generate each html page as output to save in different files by iteration of for loop.


    import requests
    import urllib.request
     
    def crawlpages():
        for i in range(1451720, 1451730):
            link = "https://www.mmo-champion.com/members/" + str(i)
            content = urllib.request.urlopen(link)
            mydata = content.read()
            with open('Newfile.html%s' %i,'wb') as file:
                file.write(mydata)
            
    crawlpages()