Skip to content

Commit 747a422

Browse files
committed
Fix compatibility with Playwright 1.58.0: replace removed devtools parameter
Playwright 1.58.0 removed the `devtools` keyword argument from `BrowserType.launch()`. Replace it with the equivalent `--auto-open-devtools-for-tabs` browser arg. https://claude.ai/code/session_01FUB8LwpNc5fy1JGHDsdWrj
1 parent 90dabf8 commit 747a422

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shot_scraper/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ def _browser_context(
409409
auth_password=None,
410410
record_har_path=None,
411411
):
412+
if devtools:
413+
browser_args = list(browser_args or []) + ["--auto-open-devtools-for-tabs"]
412414
browser_kwargs = dict(
413-
headless=not interactive, devtools=devtools, args=browser_args
415+
headless=not interactive, args=browser_args
414416
)
415417
if browser == "chromium":
416418
browser_obj = p.chromium.launch(**browser_kwargs)

0 commit comments

Comments
 (0)