Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这是什么情况? #13

Closed
zackaryhuang opened this issue Dec 16, 2018 · 5 comments
Closed

这是什么情况? #13

zackaryhuang opened this issue Dec 16, 2018 · 5 comments

Comments

@zackaryhuang
Copy link

Traceback (most recent call last):
File "main.py", line 5, in
Crawler(target).start()
File "/Users/peter/Downloads/spider/Weibo-Album-Crawler/weibo/core.py", line 24, in init
self.uid, self.name = self.target['oid'], self.target['onick']
KeyError: 'oid'

@Lodour
Copy link
Owner

Lodour commented Dec 16, 2018

默认情况下,登陆成功了才会有 oid 这个键。
如果你确认 Cookies 有效,可能是新浪的一些设定有所变化,可以尝试抓包看一看。

@CharlesLiu7
Copy link

@Peter-Huang0623 大概率是因为你没有登录成功,我的经验是这个

@roachsinai
Copy link

roachsinai commented Jan 27, 2019

screenshot_20190127_171748

配置文件只有第一项在cookie中:

COOKIES = 'SINAGLOBAL=...; UM_distinctid=...; __guid=...; ...'

@Lodour
Copy link
Owner

Lodour commented Jan 27, 2019

@roachsinai 这只是一个样例,你需要以你自己的 Cookies 为准。

@roachsinai
Copy link

好的。谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants