V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
hippoboy
V2EX  ›  Python

获取到的 cookies 是<RequestsCookieJar[]>?

  •  
  •   hippoboy · Sep 26, 2016 · 8159 views
    This topic created in 3500 days ago, the information mentioned may be changed or developed.
    最近遇到一个很奇怪的网站,哪个网站就不说了

    使用 requests.get(url).cookies 就是获取不到 cookies

    返回的是<RequestsCookieJar[]>

    但是在浏览器清空 cookies,然后访问该页面,就会有 cookies 在浏览器

    请问这个是什么"黑科技"?
    3 replies    2016-09-26 21:06:17 +08:00
    popok
        1
    popok  
       Sep 26, 2016   ❤️ 1
    你先看看哪一步的 response 返回的 set-cookie
    cheetah
        2
    cheetah  
       Sep 26, 2016   ❤️ 1
    1. 可能 js 设置 cookie 呢
    2. 可能他们判断了 UA 呢
    hippoboy
        3
    hippoboy  
    OP
       Sep 26, 2016
    @popok @cheetah 感谢,确实使用 js 设置 cookies
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1318 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:47 · PVG 07:47 · LAX 16:47 · JFK 19:47
    ♥ Do have faith in what you're doing.