Skip to content

[Feature] Allow downloads with default context when connectOverCDP is used #12543

Description

@lvyaoyu

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions