You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
from zhihu import Account
account = Account()
account.login("yxxxxxxxxxx","pxxxxxx")
Traceback (most recent call last):
File "", line 1, in
File "/home/yiwu/.local/lib/python3.5/site-packages/zhihu/models/account.py", line 29, in login
return self._login_api(account, password)
File "/home/yiwu/.local/lib/python3.5/site-packages/zhihu/models/account.py", line 35, in _login_api
_xsrf, _dc0 = self._get_xsrf_dc0()
File "/home/yiwu/.local/lib/python3.5/site-packages/zhihu/models/base.py", line 84, in _get_xsrf_dc0
xsrf = response.cookies["_xsrf"]
File "/home/yiwu/.local/lib/python3.5/site-packages/requests/cookies.py", line 329, in getitem
return self._find_no_duplicates(name)
File "/home/yiwu/.local/lib/python3.5/site-packages/requests/cookies.py", line 400, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='_xsrf', domain=None, path=None"
The text was updated successfully, but these errors were encountered:
File "/home/yiwu/.local/lib/python3.5/site-packages/requests/cookies.py", line 329, in getitem
return self._find_no_duplicates(name)
在_get_xsrf_dc0里面调用resp的cookies,获取_xsrf的值,底层requests的cookies却在no_duplicates上判断zhihu的cookie唯一时出错,在zhihu网站上,浏览器实测有两个_xsrf键和值,这是怎么回事。
其他情况zhihu.profile()调用后,输入账号密码也是报差不多的错误
$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
The text was updated successfully, but these errors were encountered: