code-dumps/py/html2text.py

7 lines
160 B
Python
Raw Normal View History

2023-12-04 15:09:02 +08:00
from urllib import request
import html2text
url = 'https://duckduckgo.com'
text = request.urlopen(url).read().decode('utf8')
print(html2text.html2text(text))