Open jamesbraza opened 7 months ago
One can get pretty close with contextlib.closing
:
import contextlib
from playwright.sync_api import sync_playwright
with sync_playwright() as p, contextlib.closing(p.chromium.launch()) as browser:
... # Use browser
However, it would be nice if this was upstreamed to Browser
itself
I have
python-playwright
with version 1.41.0, and the below code:Ideally, one can use a context manager to automate the
close()
call:Thank you for your consideration