Answers for "python download html as text"

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
0

python download html as text

import urllib.request    
urllib.request.urlretrieve("http://www.example.com/test.html", "test.txt")
Posted by: Guest on December-03-2020

Browse Popular Code Answers by Language