Skip to content

feat: extract passive metadata via CDP performance logs and request interception - #30

Merged
gildesmarais merged 3 commits into
mainfrom
feat/cdp-perf-request-inter
Aug 14, 2026
Merged

feat: extract passive metadata via CDP performance logs and request interception#30
gildesmarais merged 3 commits into
mainfrom
feat/cdp-perf-request-inter

Conversation

@gildesmarais

Copy link
Copy Markdown
Member

This pull request introduces a new helper function for passively extracting HTTP response metadata from browser automation drivers, and refactors the metadata fetching logic to use this passive approach before falling back to active network requests. Comprehensive tests are also added to ensure the new metadata extraction logic works as intended.

Metadata extraction improvements:

  • Added _extract_passive_metadata function to app/main.py that retrieves HTTP status code, headers, and URL from the driver's intercepted requests or browser performance logs, minimizing extra network calls.
  • Refactored _fetch_metadata in app/main.py to first attempt passive metadata extraction using the new helper, only falling back to active network requests if necessary.

Testing enhancements:

  • Added tests for _extract_passive_metadata to tests/test_api_contract.py, covering both extraction from a driver's requests list and from browser performance logs.

Comment thread app/main.py Fixed
Comment thread app/main.py Fixed
@gildesmarais gildesmarais changed the title feat(scraper): extract passive metadata via CDP performance logs and request interception feat: extract passive metadata via CDP performance logs and request interception Aug 14, 2026
@gildesmarais
gildesmarais enabled auto-merge (squash) August 14, 2026 13:55
@gildesmarais
gildesmarais merged commit c67ee53 into main Aug 14, 2026
9 checks passed
@gildesmarais
gildesmarais deleted the feat/cdp-perf-request-inter branch August 14, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant