想使用 python playwright 自动化,先登录,手动控制浏览器关闭,每次执行方法时 生成一个新的标签页 方法结束时关掉新的标签页,
封装playwright 的时候 发现这个问题,不知道时什么原因
python playwright
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)
这样就能执行
browser = sync_playwright().chromium.launch(headless=False)
这样就直接报错
AttributeError: 'PlaywrightContextManager' object has no attribute 'chromium'