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

您好,请问出现这样的错误显示该怎么解决呢? #51

Open
countingRGB opened this issue Mar 10, 2020 · 4 comments
Open

Comments

@countingRGB
Copy link

Error: list index out of range
Traceback (most recent call last):
File "E:\weiboSpider.py", line 161, in extract_user_info
if selector.xpath("//div[@Class='tip'][2]/text()")[0] == u'学习经历':
IndexError: list index out of range
Error: invalid literal for int() with base 10: ''
Traceback (most recent call last):
File "E:\weiboSpider.py", line 254, in get_user
weibo_num = int(user_info[0][3:-1])
ValueError: invalid literal for int() with base 10: ''

@dataabc
Copy link
Owner

dataabc commented Mar 10, 2020

如果方便,能否提供user_id,方便调试,谢谢

@countingRGB
Copy link
Author

如果方便,能否提供user_id,方便调试,谢谢

1005051747778640

@dataabc
Copy link
Owner

dataabc commented Mar 11, 2020

测试了下,没有复现错误,可以获取数据,猜测上述错误应该是被限制了,限制一段时间会自动解除限制。不知道是所有id都出错还是只这一个,还有这个账号过一段时间再试应该可以获取信息。

感谢反馈,如果有其它问题或建议,欢迎继续反馈

@countingRGB
Copy link
Author

非常感谢!之后又试了一次,能够成功抓取了。

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