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

Python 爬虫时遇到反爬请求需要带上 cookies 中的 cna, 1.这个 cna 是什么东西呢; 2.第一次请求为啥会带 cookies;

  •  
  •   wxinchen · 2021-06-10 10:50:26 +08:00 · 2695 次点击
    这是一个创建于 1041 天前的主题,其中的信息可能已经有所发展或是发生改变。

    cookies: cna=RZM8GU+BTz0CAXWIWc3cpC1;

    7 条回复    2021-06-13 01:15:58 +08:00
    huayunbin
        1
    huayunbin  
       2021-06-10 10:51:49 +08:00
    这是爬淘宝么-.-
    tiaod
        2
    tiaod  
       2021-06-10 10:59:35 +08:00
    别爬了,前段时间进去一个
    https://www.bilibili.com/read/cv11657051/
    wxinchen
        3
    wxinchen  
    OP
       2021-06-10 11:10:07 +08:00
    不是淘宝,这个 cookies 是服务端返回来的
    yaoye555
        4
    yaoye555  
       2021-06-10 11:34:29 +08:00
    阿里系的站点都会有 cna
    scukmh
        5
    scukmh  
       2021-06-10 11:51:58 +08:00
    逯某预定
    winglight2016
        6
    winglight2016  
       2021-06-10 20:27:09 +08:00
    服务端下发 cookie 还需要问为什么吗?很多用途呀,标记 session 、device id 、用户、来源等等

    你不知道怎么处理,先试试原样发回去吧
    wxinchen
        7
    wxinchen  
    OP
       2021-06-13 01:15:58 +08:00
    好像这个 cna 会过期,因为我是初学 js 逆向,所以还不知道怎么找,可能用 js hook 啥的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3509 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 11:38 · PVG 19:38 · LAX 04:38 · JFK 07:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.