Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #download #html #text
ADD COMMENT
Topic
Name
3+9 =