from urllib import request
class Spider(object):
url = 'https://www.huya.com/l'
def __fetch_content(self):
r = request.urlopen(Spider.url)
htmls = r.read()
htmls = str(htmls, encoding='utf-8')
a = 1
def go(self):
self.__fetch_content()
spider = Spider()
spider.go()