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

想爬一下 coursera.org,遇到了问题

  •  
  •   feather12315 · Nov 21, 2015 · 2476 views
    This topic created in 3892 days ago, the information mentioned may be changed or developed.
    在学习爬虫,看到了这篇文章:
    [Python 爬虫(二)--Coursera 抓站小结]( http://www.jianshu.com/p/c3dbf8294c33)
    就想爬一下。但是发现 couresra 现在的登陆方式与文章内容有出入,`csrf2-token`等不见了,出现了`csrf3-token` ,尝试了好几次,都没有模拟登陆成功 。水平太低,不知道怎么办了,求帮助。
    正确的模拟登陆姿势是怎样的呢
    1 replies    2015-11-24 16:40:44 +08:00
    aragakiiyui
        1
    aragakiiyui  
       Nov 24, 2015
    改了规则啊。。。貌似开了 api ,不过我懒得看,前段时间写了个模拟登录,成功了。不过代码删了。。你非要用写原生代码抓的话。登录页面有个 csrfToken , 你第一步用正则把这个抠出来。然后把你邮箱和密码 post 一下,貌似是这个地址:
    https://www.coursera.org/api/login/v3Ssr?csrf3-token=你的 csrfToken 值。应该就能登录了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2907 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 05:50 · PVG 13:50 · LAX 22:50 · JFK 01:50
    ♥ Do have faith in what you're doing.