Skip to content

RuntimeError: Event loop is closed #550

@JacobLee23

Description

@JacobLee23

After running pip install playwright and playwright install, I went to the documentation to try some of the features out. Here is the code which I ran:

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    browser = p.chromium.launch()
page = browser.new_page()

However, I received an error: RuntimeError: Event loop is closed.

I proceeded to try the same process by with browser=p.firefox.launch(), but to no avail.

Specifications:

  • Python 3.9.2
  • Playwright v1.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions