mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
19 lines
487 B
Markdown
19 lines
487 B
Markdown
![]() |
## async method: Playwright.stop
|
||
|
* langs: python
|
||
|
|
||
|
Terminates this instance of Playwright in case it was created bypassing the Python context manager. This is useful in REPL applications.
|
||
|
|
||
|
```py
|
||
|
>>> from playwright import sync_playwright
|
||
|
|
||
|
>>> playwright = sync_playwright().start()
|
||
|
|
||
|
>>> browser = playwright.chromium.launch()
|
||
|
>>> page = browser.newPage()
|
||
|
>>> page.goto("http://whatsmyuseragent.org/")
|
||
|
>>> page.screenshot(path="example.png")
|
||
|
>>> browser.close()
|
||
|
|
||
|
>>> playwright.stop()
|
||
|
```
|