Commit Graph

4 Commits

Author SHA1 Message Date
Nick Sweeting
96682d8910 switch back from patchright to playwright until issues are resolved 2025-05-09 18:14:07 -07:00
RogelioRichmanAstronaut
0e5c676504 fix: Apply pre-commit linting fixes and improve Playwright example script execution
- Applied automated linting suggestions from pre-commit hooks, primarily updating type hints (e.g., Dict -> dict) and organizing imports.
- Refactored Playwright script execution in examples/features/playwright_script_generation.py to use asyncio.create_subprocess_exec for asynchronous handling and real-time log streaming, resolving ASYNC221 lint error and improving output visibility.
2025-04-30 00:05:36 -05:00
RogelioRichmanAstronaut
83b21d3124 Fix: Update Playwright script generator imports to use patchright
Update imports in Playwright script generation and helper files to use `patchright` instead of `playwright`, aligning with current project dependencies.

Co-Authored-By: Nick Sweeting <511499+pirate@users.noreply.github.com>
2025-04-29 23:32:09 -05:00
RogelioRichmanAstronaut
fea4e7759c Refactor: Extract Playwright script helpers to separate file
Moved helper functions (replace_sensitive_data, _try_locate_and_act, PlaywrightActionError) from a multiline string within PlaywrightScriptGenerator into browser_use/agent/playwright_script_helpers.py.

    This allows linters and type checkers to analyze the helper code, improving maintainability and code quality. The generator now reads the helper file content dynamically.

Co-Authored-By: Nick Sweeting <511499+pirate@users.noreply.github.com>
2025-04-29 23:25:44 -05:00