zoukankan      html  css  js  c++  java
  • python爬虫错误:http.client.HTTPException: got more than 100 headers的解决方法

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

    Traceback (most recent call last):
    File "C:UsersJonariguezAppDataRoamingPythonPython36site-packagesurllib3connectionpool.py", line 601, in urlopen
    chunked=chunked)
    File "C:UsersJonariguezAppDataRoamingPythonPython36site-packagesurllib3connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
    File "<string>", line 2, in raise_from
    File "C:UsersJonariguezAppDataRoamingPythonPython36site-packagesurllib3connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
    File "D:SoftwarePython3libhttpclient.py", line 1331, in getresponse
    response.beg

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

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

    python3

    import http.client
    
    http.client._MAXHEADERS = 1000

    python2

    import httplib
    
    httplib._MAXHEADERS = 1000
  • 相关阅读:
    树剖学习笔记
    网络命令
    shell编程
    Shell 脚本常用命令
    WP7系统托盘和应用程序栏
    Ajax的同步与异步
    WP7推送通知服务
    (转)Silverlight控件关系理解
    (转) silverlight 样式学习
    (转C#中Enum用法小结)
  • 原文地址:https://www.cnblogs.com/yunlongaimeng/p/11940226.html
Copyright © 2011-2022 走看看