无法获取hymls 的值

来源:13-5 HTML结构分析基本原则二条

狂人7

2018-10-22

from urllib import request

import ssl

ssl._create_default_https_context = ssl._create_unverified_context

class Spider():
url = ‘https://www.panda.tv/cate/lol

def __fetch_content(self):
    r = request.urlopen(Spider.url)
    htmls = r.read()
    a = 1

def go(self):
    self.__fetch_content()

spider = Spider()
spider.go()

写回答

3回答

狂人7

提问者

2018-10-22

已经解决。

mac 系统的同学,找到python安装包里面的这个文件,运行一下。关掉ide,重新打开,即可不报错。

/Applications/Python\ 3.6/Install\ Certificates.command

0
1
狂人7
详情请看: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error/42334357#42334357
2018-10-22
共1条回复

狂人7

提问者

2018-10-22

//img.mukewang.com/szimg/5bccc22d00011d7a13860255.jpg

。htmls 没有数值

0
0

狂人7

提问者

2018-10-22

我是mac系统

0
0

Python3.8系统入门+进阶 (程序员必备第二语言)

语法精讲/配套练习+思考题/原生爬虫实战

14640 学习 · 4477 问题

查看课程