We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__enter__
__exit__
Browser
I have python-playwright with version 1.41.0, and the below code:
python-playwright
from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch() ... # Use browser browser.close()
Ideally, one can use a context manager to automate the close() call:
close()
from playwright.sync_api import sync_playwright with sync_playwright() as p, p.chromium.launch() as browser: ... # Use browser
Thank you for your consideration
The text was updated successfully, but these errors were encountered:
One can get pretty close with contextlib.closing:
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
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: