playwright = sync_playwright().start()
executable_path = playwright.chromium.executable_path
logger.debug(f'executable_path:{executable_path}')
server = subprocess.Popen(f"{executable_path} --remote-debugging-port=9002")
time.sleep(2)
print(f'server:{server.pid}')
browser = playwright.chromium.connect_over_cdp(
endpoint_url=f"http://localhost:9002",
)
如何给这个context 赋予accept_downloads属性
context = browser.contexts[0]
重新new的context可以赋予accept_downloads属性
context1 = browser.new_context(accept_downloads=True)
playwright = sync_playwright().start()
executable_path = playwright.chromium.executable_path
logger.debug(f'executable_path:{executable_path}')
server = subprocess.Popen(f"{executable_path} --remote-debugging-port=9002")
time.sleep(2)
print(f'server:{server.pid}')
browser = playwright.chromium.connect_over_cdp(
endpoint_url=f"http://localhost:9002",
)
如何给这个context 赋予accept_downloads属性
context = browser.contexts[0]
重新new的context可以赋予accept_downloads属性
context1 = browser.new_context(accept_downloads=True)