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

Coursera 模拟登陆中的 CSRF checks 问题

  •  
  •   LXY1 · Dec 16, 2015 · 2109 views
    This topic created in 3784 days ago, the information mentioned may be changed or developed.

    最近在想用 python 爬下 coursera 中课程视频的链接,发现必须要登陆才能爬,在模拟登陆时,有个 csr3_token 值,在网页中得到了那个值,放到了 URL 里面,但是网页返回
    "errorCode":"csrfRequired","message":"Your request did not pass CSRF checks. 。。。。。。
    这个问题该怎么解决,用的是 requests 中的 post 方法

    1 replies    2015-12-23 17:05:37 +08:00
    suzision
        1
    suzision  
       Dec 23, 2015
    coursera 里面有多个 csrf 值,不需要从返回的值里提取,问题既然说了 csrf 错误,就重新确认一下是否把所有的 csrf 值发送咯
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   874 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:02 · PVG 06:02 · LAX 15:02 · JFK 18:02
    ♥ Do have faith in what you're doing.