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

IndexError: list index out of range #17

Closed
misaka00251 opened this issue Mar 7, 2018 · 4 comments
Closed

IndexError: list index out of range #17

misaka00251 opened this issue Mar 7, 2018 · 4 comments

Comments

@misaka00251
Copy link

用户名: 新浪
Error:  list index out of range
Traceback (most recent call last):
  File "weiboSpider.py", line 56, in get_user_info
    "//div[@class='tip2']/span[@class='tc']/text()")[0]
IndexError: list index out of range
Error:  list index out of range
Traceback (most recent call last):
  File "weiboSpider.py", line 113, in get_weibo_info
    is_empty = info[0].xpath("div/span[@class='ctt']")
IndexError: list index out of range
@dataabc
Copy link
Owner

dataabc commented Mar 8, 2018

如果没想错,你的cookie没有写对。按照README获取cookie,把your cookie 替换成你获取的cookie就可以正确运行

@misaka00251
Copy link
Author

misaka00251 commented Mar 10, 2018

SUB=xxx; SCF=xxx; SSOLoginState=xxx; _T_WM=xxx; WEIBOCN_FROM=xxx; M_WEIBOCN_PARAMS=xxx

Cookie 里有这些内容,直接复制粘贴的...

@dataabc
Copy link
Owner

dataabc commented Mar 10, 2018

刚才试了一遍,可以正确运行。我认为可能是cookie没有正确获取或者过期了,你可以退出登录,按readme重新获取。因为这个错误很可能是cookie,我以前见过类似的错误,修改cookie就可以了。如果还出错,可以告诉我被爬微博的id(如果方便的话),我测试下

@misaka00251
Copy link
Author

果然是 Cookie 的错误 ...

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

2 participants