fix: Handle encoding errors in selectolax by switching to BeautifulSoup#569
Merged
drunkpig merged 3 commits intoccprocessor:devfrom Oct 15, 2025
Merged
fix: Handle encoding errors in selectolax by switching to BeautifulSoup#569drunkpig merged 3 commits intoccprocessor:devfrom
drunkpig merged 3 commits intoccprocessor:devfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## dev #569 +/- ##
==========================================
+ Coverage 90.97% 91.04% +0.06%
==========================================
Files 102 106 +4
Lines 8890 9333 +443
==========================================
+ Hits 8088 8497 +409
- Misses 802 836 +34
... and 11 files with indirect coverage changes 🚀 New features to boost your workflow:
|
drunkpig
requested changes
Oct 10, 2025
Contributor
drunkpig
left a comment
There was a problem hiding this comment.
bs4在效率上比lxml低10倍。建议采用try...except fallback的形式,在捕获到exception之后再采用bs4兜底
drunkpig
approved these changes
Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
selectolax 会默认将网页字符串视为'utf-8'编码,如果不是这个编码会报错,而BeautifulSoup可以更自动地处理编码问题,所以如果修复html的步骤遇到编码错误,则替换为BeautifulSoup