scrapy 爬取今日头条报错 'SSL routines', 'SSL23_GET_SERVER_HELLO', 'unknown protocol'

初次爬取时,代码没有问题,可以正常爬取,过了两日后,再次运行代码时,就抛出异常

ERROR: <twisted.python.failure.Failure twisted.web._newclient.ResponseNeverReceived: [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'unknown protocol')]>]>

经多方搜索,找到解决方法:

pip uninstall scrapy
pip uninstall pyopenssl
pip install pyopenssl
pip install scrapy

即版本有点低了,不支持以上抛异常的连接方式
参考文章:
https://blog.csdn.net/lzc4869/article/details/79528505?utm_source=blogxgwz4
https://blog.csdn.net/qq_24861509/article/details/48019613

猜你喜欢

转载自blog.csdn.net/HYESC/article/details/86680209