Created
August 7, 2019 08:25
-
-
Save tranchausky/5c6c7903f46dedf0f71f7a94d0caa09c to your computer and use it in GitHub Desktop.
python save html tag data content website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
r = requests.get("https://stackoverflow.com/questions/47503845/save-html-content-into-a-txt-file-using-python") | |
data = r.text | |
soup = BeautifulSoup(data) | |
print(soup) | |
with open ('/tmp/test.html', 'a') as f: | |
f.write(str(soup)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment