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

该爬虫在爬取只有表情的微博时,会出现*****Error: Failed to extract text. #9

Open
HeZhang1994 opened this issue Apr 21, 2019 · 5 comments
Labels
wontfix This will not be worked on

Comments

@HeZhang1994
Copy link
Owner

因为某些微博表情无法解码保存。

@HeZhang1994 HeZhang1994 added the wontfix This will not be worked on label Apr 21, 2019
@710898666
Copy link

Traceback (most recent call last):
File "run_WeiboCrawler.py", line 142, in
cards_list.append(content['data']['cards']) # content['data']['cards']
KeyError: 'cards'

@HeZhang1994
Copy link
Owner Author

Traceback (most recent call last):
File "run_WeiboCrawler.py", line 142, in
cards_list.append(content['data']['cards']) # content['data']['cards']
KeyError: 'cards'

Hi, I did not get this error when I run this code today.

@little7Li
Copy link

Traceback (most recent call last):
File "run_WeiboCrawler.py", line 142, in
cards_list.append(content['data']['cards']) # content['data']['cards']
KeyError: 'cards'

i got the same error as yours when i try this url
USER_URL = r'https://m.weibo.cn/api/container/getIndex?type=uid&value=1722782045&containerid=1005051722782045'

@little7Li
Copy link

little7Li commented Feb 14, 2020

Traceback (most recent call last):
File "run_WeiboCrawler.py", line 142, in
cards_list.append(content['data']['cards']) # content['data']['cards']
KeyError: 'cards'

i got the same error as yours when i try this url
USER_URL = r'https://m.weibo.cn/api/container/getIndex?type=uid&value=1722782045&containerid=1005051722782045'

i have solved this problem by correct the containerid in USER_URL, acctually when containerid = 107603+uid (such as when uid=1722782045 then containerid=1076031722782045 ), you can run this successfully!

@HeZhang1994
Copy link
Owner Author

HeZhang1994 commented Feb 14, 2020

Traceback (most recent call last):
File "run_WeiboCrawler.py", line 142, in
cards_list.append(content['data']['cards']) # content['data']['cards']
KeyError: 'cards'

i got the same error as yours when i try this url
USER_URL = r'https://m.weibo.cn/api/container/getIndex?type=uid&value=1722782045&containerid=1005051722782045'

i have solved this problem by correct the containerid in USER_URL, acctually when containerid = 107603+uid (such as when uid=1722782045 then containerid=1076031722782045 ), you can run this successfully!

Hi, thanks for your reply. I have tried to get the USER_URL of user 1722782045 according to the comment in the code. It should be https://m.weibo.cn/api/container/getIndex?type=uid&value=1722782045&containerid=1076031722782045 (just like yours). Maybe you can check the content in XHR/Headers, sometimes it will show alert or warning information. In this case, the URL you get might be wrong or invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants