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
tuoov
V2EX  ›  Python

为什么抓不到 scrapy 的包

  •  
  •   tuoov · 2021-02-20 14:00:28 +08:00 · 1687 次点击
    这是一个创建于 1154 天前的主题,其中的信息可能已经有所发展或是发生改变。

    开着 fiddler 干别的事情,一段时间后发现完全没有爬虫程序的记录。 程序和 fiddler 都在正常工作,用的是最新的 fiddler everywhere,开了捕获 https 请求。 请知道的大佬解释下原因

    6 条回复    2021-02-20 22:13:27 +08:00
    julyclyde
        1
    julyclyde  
       2021-02-20 14:06:23 +08:00
    fiddler 是个代理服务器
    Itoktsnhc
        2
    Itoktsnhc  
       2021-02-20 14:17:30 +08:00
    fiddle 只能抓到使用系统配置代理的程序的请求 手动设置一下试试?
    smart9527
        3
    smart9527  
       2021-02-20 14:22:44 +08:00
    fiddler 是个代理服务器, scrapy 要设置代理
    woyao396
        4
    woyao396  
       2021-02-20 14:28:30 +08:00   ❤️ 1
    https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware

    原因就是 1&2 楼

    设置环境变量 http_proxy 及 https_proxy 为 fiddler 代理服务器的地址

    linx

    ```sh
    #host 为 fiddler 所在 IP,8888 是 fiddler 默认端口号 如:
    export http_proxy=http://localhost:8888
    export https_proxy=http://localhost:8888
    ```

    windows

    ```sh
    set http_proxy=http://localhost:8888
    set https_proxy=http://localhost:8888
    ```
    tuoov
        5
    tuoov  
    OP
       2021-02-20 15:05:56 +08:00
    感谢各位
    ch2
        6
    ch2  
       2021-02-20 22:13:27 +08:00
    fiddler 只能抓到对局域网代理生效的程序的包
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2546 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 15:33 · PVG 23:33 · LAX 08:33 · JFK 11:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.