关于爬虫代码错误
来源:13-7 正则分析HTML
Jokky
2018-08-03
from urllib import request class Spider(): url = 'https://www.panda.tv/cate/lol' def __fetch_content(self): r = request.urlopen(Spider.url) htmls = r.read() htmls = str(htmls,encoding='utf-8') def __analysis(self,htmls): pass def go(self): htmls = self.__fetch_content() self.__analysis(htmls) spider = Spider() spider.go()
E1111:Assigning to function call which doesn't return
请问下 htmls那边红色波浪直接报错 请问是哪里问题
写回答
2回答
-
mac下面?把这个错误SSL。。。百度下,有解决方案。
122018-08-04 -
Jokky
提问者
2018-08-03
终端报错如下
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)>
10
相似问题