Код: Выделить всё
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from html2text import html2text
sock = html2text(urllib2.urlopen('http://www.example.com'))
htmlSource = sock.read()
sock.close()
print (htmlSource)
Подробнее здесь: https://stackoverflow.com/questions/309 ... te-replace