在 Playwright 打开的浏览器上手动打开一个新标签页
我正在使用 Playwright for Python 打开浏览器,访问 URL,然后执行一些操作。
- 我可以在代码运行后保持浏览器的窗口打开吗?
- 如果我在 Python 代码中设置断点,我无法在 Playwright 打开的浏览器中打开新选项卡:页面保持空白。我该怎么做才能保持该选项卡打开?
我的代码:
from playwright.sync_api import sync_playwright
playwright = sync_playwright().start()
browser = playwright.chromium.launch(headless=False)
context = browser.new_context()
auth_page = context.new_page()
auth_page.goto("https://www.toto.fr/")
print('Put breakpoint here')