Skip to content

Handle error for keyword search#864

Open
P-mandevillei wants to merge 1 commit into
NanmiCoder:mainfrom
P-mandevillei:main
Open

Handle error for keyword search#864
P-mandevillei wants to merge 1 commit into
NanmiCoder:mainfrom
P-mandevillei:main

Conversation

@P-mandevillei
Copy link
Copy Markdown

WeiboCrawler.search raises tenacity.RetryError / DataFetchError when it goes too deep and runs out of notes (weibo API returns res:{'ok': 0, 'msg': '这里还没有内容', 'data': {'cards': []}}), which breaks the program. This becomes a headache when the user specified a long list of keywords and expected the crawler to finish searching as much as possible for all of them.

Add error handling for keyword search in WeiboCrawler so it moves on to the next keyword when it runs out of notes instead of crashing the whole program.

Add error handling for keyword search in WeiboCrawler so it moves on to the next keyword instead of crashing the whole program.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant