V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
aladdindingding
V2EX  ›  Python

scrapy 项目中怎么获取代理 IP 呢

  •  
  •   aladdindingding · 2020-06-17 17:51:35 +08:00 · 1630 次点击
    这是一个创建于 1409 天前的主题,其中的信息可能已经有所发展或是发生改变。

    大佬们好,是这样的,目前的代码中有一个固定的列表 ip 池作为代理 ip,每隔一段时间需要手动去更换,我想要实现一个动态去获取批量 ip,获取的地址已经有了 API 的接口,想要在 scrapy 项目代码中增加这个功能,不用数据库这样的怎么操作呢

    6 条回复    2020-06-18 09:20:35 +08:00
    scukmh
        1
    scukmh  
       2020-06-17 18:00:43 +08:00
    Latin
        2
    Latin  
       2020-06-17 18:08:18 +08:00
    自己写中间件鸭
    jiaxin1121
        3
    jiaxin1121  
       2020-06-17 18:12:58 +08:00
    公开代理池基本没法用。
    renmu123
        4
    renmu123  
       2020-06-17 18:25:09 +08:00 via Android
    github 找个维护 ip 池的库,应该有挺多的
    aladdindingding
        5
    aladdindingding  
    OP
       2020-06-17 18:28:53 +08:00
    @renmu123 买了 api 链接的 可以提取 IP 的 就是不知道怎么在 scrapy 开启一个线程去维护一个实时可用的 IP 池
    1018ji
        6
    1018ji  
       2020-06-18 09:20:35 +08:00
    ip 隧道吧
    简单
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1658 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:13 · PVG 01:13 · LAX 10:13 · JFK 13:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.