This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Replace Selenium with Playwright for browser automation#1153
Closed
jcroy wants to merge 2 commits intofeder-cr:mainfrom
Closed
Replace Selenium with Playwright for browser automation#1153jcroy wants to merge 2 commits intofeder-cr:mainfrom
jcroy wants to merge 2 commits intofeder-cr:mainfrom
Conversation
Selenium + ChromeDriver + undetected-chromedriver were the only browser automation deps and were used for two things: scraping job pages and converting HTML to PDF via CDP. Playwright handles both natively with a simpler API (page.pdf(), page.goto()) and easier install on WSL. Changes: - Rewrite src/utils/chrome_utils.py to use Playwright sync API - Update resume_facade.py to use Playwright page methods - Remove Selenium imports from main.py and src/logging.py - Add monkey-patch for lib_resume_builder_AIHawk's Selenium usage - Swap selenium/webdriver-manager/undetected-chromedriver for playwright in requirements.txt - Bump Levenshtein>=0.26.0 for Python 3.13 compat - Switch default LLM model to gpt-5-mini Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
_create_driver_playwright was spinning up a new sync_playwright() instance, which conflicts with the already-running one from chrome_utils at runtime. Now reuses the shared browser pool via _get_browser(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
patch_lib_resume_builder.py) to redirect the externallib_resume_builder_AIHawklibrary's Selenium calls to Playwright at runtimechrome_utilsChanges
chrome_utils.py— Rewrote with Playwright sync API, browser pooling, native PDF generationresume_facade.py— Migrateddriver.get()→goto(),find_element()→locator(),quit()→close()patch_lib_resume_builder.py— New file; monkey-patcheslib_resume_builder_AIHawkto use Playwrightmain.py— Removed Selenium imports, added patch applicationlogging.py— Removed Selenium-specific logger initconfig.py— RemovedLOG_SELENIUM_LEVELrequirements.txt— Removedselenium,webdriver-manager,undetected-chromedriver; addedplaywright>=1.40.0Test plan
_create_driver_playwright,_html_to_pdf_from_file)apply_patch()executes without error🤖 Generated with Claude Code