crawl4ai
An open-source Python library for crawling websites and extracting their content.
Keeping the crawler responsive
When a page did not specify its text encoding, Crawl4AI ran encoding detection on the event loop, holding up other tasks. I moved that work into a worker thread so the crawler could continue handling other tasks while detection ran. Pages still fall back to UTF-8 when no encoding is detected.
Fixing a crash when adding URL filters
Adding a URL filter crashed because the method tried to append to a tuple, which does not support that operation. I changed it to create a new tuple containing the existing filters and the added filter. This preserved the tuple-based storage and kept method chaining working.