playwright运行时会 弹出 cmd命令
cmd窗口弹出3秒后自动关闭, 怎么才不弹出这个? please paste all your code with <>. 图没有,代码也没有{:10_277:} isdkz 发表于 2023-4-23 23:24图没有,代码也没有
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
chromium = p.chromium
browser = chromium.launch()
context = browser.new_context()
page = context.new_page()
page.goto("xxx")
page.screenshot(path="screenshot.png")
browser.close() hcll706 发表于 2023-4-24 07:31
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
代码 没有问题 就是 出来CMD命令窗口 一闪即过 类似 打包py为 exe文件运行时的那种 playwrigh版本1.30和1.31版本会出现cmd,但是1.29版本不会出现,所以解决方法就是版本降低到1.29.0版本
在cmd中运行:
pip install playwright==1.29.0
页:
[1]