Answers for "how to save html page in python"

1

how to download a page in python

import urllib.request, urllib.error, urllib.parse
url = "The url of the page you want to download"
response = urllib.request.urlopen(url)
Posted by: Guest on July-16-2020
0

python download html as text

import requests

url = "https://stackoverflow.com/questions/24297257/save-html-of-some-website-in-a-txt-file-with-python"

r = requests.get(url)
with open('file.txt', 'w') as file:
    file.write(r.text)
Posted by: Guest on December-03-2020

Code answers related to "how to save html page in python"

Browse Popular Code Answers by Language