crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

fix: follow single-frame framesets

Open nightcityblade opened this issue 6 months ago • 0 comments

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 - Add follow_frames runtime config with a default of True and 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

nightcityblade avatar May 21 '26 15:05 nightcityblade