当前位置:Gxlcms > Python > 如何利用python登录知乎页面?

如何利用python登录知乎页面?

时间:2021-07-01 10:21:17 帮助过:67人阅读

回复内容:

import requests
from bs4 import BeautifulSoup

s = requests.Session()
r = s.post('http://www.zhihu.com/login',
           data={'_xsrf': BeautifulSoup(s.get('http://www.zhihu.com/').content).find(type='hidden')['value'],
                 'email': 'email', 'password': 'password', 'rememberme': 'y'})
print(r.text)
参考下我之前写的:github.com/flyer103/zhi 现在登录的时候都会有验证码验证,楼上几个程序应该运行不成功吧?

人气教程排行