码迷,mamicode.com
首页 > 编程语言 > 详细

python爬虫错误:http.client.HTTPException: got more than 100 headers的解决方法

时间:2019-11-27 10:46:35      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:最大   style   connect   packages   most   lin   ons   software   file   

python爬虫错误:http.client.HTTPException: got more than 100 headers的解决方法

Traceback (most recent call last):
File "C:\Users\Jonariguez\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\Jonariguez\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\Users\Jonariguez\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "D:\Software\Python3\lib\http\client.py", line 1331, in getresponse
response.beg

错误
返回的请求头大多,超过了自定义的最大请求头个数

解决方法:
修改最大请求头个数即可。

python3

import http.client

http.client._MAXHEADERS = 1000

 

python2

import httplib

httplib._MAXHEADERS = 1000

 

python爬虫错误:http.client.HTTPException: got more than 100 headers的解决方法

标签:最大   style   connect   packages   most   lin   ons   software   file   

原文地址:https://www.cnblogs.com/yunlongaimeng/p/11940226.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!