推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
SpiderXiantang
V2EX  ›  Python

requests 在并发太高的情况下 报错

  •  
  •   SpiderXiantang ·
    xiantang · Aug 3, 2018 · 4516 views
    This topic created in 3020 days ago, the information mentioned may be changed or developed.

    也就开了 32 个线程这样,爬一会就疯狂报错 然后把并发改为 10 之后就可以正常爬了

    requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:645)
    

    还有个问题:爬虫插入 mysql 的策略是什么? 一定数量批量插 还是一条一条插 感觉一条条插在高并发的情况下十分不稳定

    8 replies  •  2018-08-04 15:44:30 +08:00
    xxxy
    xxxy
    Aug 3, 2018
    1
    貌似是 openssl 的限制?
    lhy360121
    lhy360121
    Aug 3, 2018
    2
    批量插
    lllllllllllllll
    lllllllllllllll
    Aug 3, 2018
    3
    pip install 'requests[security]'
    nu11001
    nu11001
    Aug 3, 2018
    4
    试试异步 aiohttp
    SpiderXiantang
    SpiderXiantang
    OP
    Aug 3, 2018
    5
    @xxxy 后来我发现 我开并发为 10 的情况下也会报错
    SpiderXiantang
    SpiderXiantang
    OP
    Aug 3, 2018
    6
    @lllllllllllllll 我试试
    awah
    awah
    Aug 3, 2018 via Android
    7
    @SpiderXiantang 你好,我也遇到这个问题。请问解决了吗?
    SpiderXiantang
    SpiderXiantang
    OP
    Aug 4, 2018
    8
    @luguhu 安装 requets[security]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1187 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:44 · PVG 01:44 · LAX 09:44 · JFK 12:44
    ♥ Do have faith in what you're doing.