crawl4ai
crawl4ai copied to clipboard
fix: follow single-frame framesets
Summary
Fixes #1974
Add support for following single-frame frameset wrappers by returning the already-loaded child frame content and surfacing the child frame URL as the redirected URL.
List of files changed and why
crawl4ai/async_crawler_strategy.py- Detect conservative single-frame framesets and use the child frame HTML instead of the empty frameset shell.crawl4ai/async_configs.py- Addfollow_framesruntime config with a default ofTrueand serialization support.tests/test_follow_frames.py- Cover frameset following, multi-frame rejection, and config round-tripping.
How Has This Been Tested?
. .venv/bin/activate && python -m pytest tests/test_follow_frames.py
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] I have added/updated unit tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes