Skip to content

fix: fall back to httpx when playwright is missing#4969

Open
MobiusL00p wants to merge 1 commit intoAider-AI:mainfrom
MobiusL00p:fix-playwright-httpx-fallback
Open

fix: fall back to httpx when playwright is missing#4969
MobiusL00p wants to merge 1 commit intoAider-AI:mainfrom
MobiusL00p:fix-playwright-httpx-fallback

Conversation

@MobiusL00p
Copy link
Copy Markdown

Summary

  • catch ModuleNotFoundError when the /web scrape path tries to use Playwright without the optional dependency installed
  • mark Playwright unavailable for the current scraper instance and fall back to the existing httpx scraping path
  • add a regression test covering the fallback behavior without requiring Playwright to be installed locally

Verification

  • python -m pytest tests/scrape/test_scrape.py -k playwright_missing
  • python -m pytest tests/scrape/test_scrape.py -k "playwright_missing or scrape_text_plain or scrape_text_html"
  • python -m compileall aider/scrape.py tests/scrape/test_scrape.py

Closes #4911.

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.

Uncaught ModuleNotFoundError in scrape.py line 144

1 participant