from urllib import request
from io import BytesIO
import gzip
class Spider():
url = 'https://www.bing.com'
def __fetch_content(self):
r = request.urlopen(self.url)
htmls = r.read()
buff = BytesIO(htmls)
f = gzip.GzipFile(fileobj=buff)
htmls = f.read().decode('utf-8')
print(htmls)
def go(self):
self.__fetch_content()