推荐学习书目
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
somejustl
V2EX  ›  Python

求助大佬,为什么用 requests 库的同一份代码,平台不一样,结果也不一样

  •  
  •   somejustl · Nov 3, 2021 · 2059 views
    This topic created in 1678 days ago, the information mentioned may be changed or developed.
    在 win10 上能够正常捕捉到重定向 url ,在 linux 上却捕捉不到。我调试看了一下,win10 和 linux 的 response 里,唯一有区别的就是 win10 的 history 不为空,而 linux 为空。
    win10 python3.9 ,linux python 3.69 ,求大佬解答,不胜感激。
    4 replies    2021-11-13 17:58:55 +08:00
    jifengg
        1
    jifengg  
       Nov 3, 2021
    先看发出的 request 里面是否有不一样的,包括但不限制于 ua 。如果公网 ip 不一样,也可以做怀疑对象
    deplivesb
        2
    deplivesb  
       Nov 3, 2021
    大佬们也不会悬丝诊脉
    gxt92
        3
    gxt92  
       Nov 3, 2021
    pip3 list | grep requests

    看看 requests 库版本是不是一样的。
    llsquaer
        4
    llsquaer  
       Nov 13, 2021
    可能 linux 少了啥配套的东西, 就好像 gzip ,本地没有解码器的话,随便你用什么编码,都是乱码...曾经就掉在这个坑了.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5477 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 07:10 · PVG 15:10 · LAX 00:10 · JFK 03:10
    ♥ Do have faith in what you're doing.