mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
59 lines
2.1 KiB
Markdown
59 lines
2.1 KiB
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()
|
||
|
```
|
||
|
|
||
|
### param: BrowserContext.addInitScript.path
|
||
|
* langs: python
|
||
|
- `path` <[path]>
|
||
|
|
||
|
Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
|
||
|
|
||
|
|
||
|
### param: BrowserContext.addInitScript.script
|
||
|
* langs: python
|
||
|
- `script` <[string]>
|
||
|
|
||
|
Script to be evaluated in all pages in the browser context. Optional.
|
||
|
|
||
|
### param: Page.addInitScript.path
|
||
|
* langs: python
|
||
|
- `path` <[path]>
|
||
|
|
||
|
Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
|
||
|
|
||
|
### param: Page.addInitScript.script
|
||
|
* langs: python
|
||
|
- `script` <[string]>
|
||
|
|
||
|
Script to be evaluated in all pages in the browser context. Optional.
|
||
|
|
||
|
### param: ElementHandle.selectOption.element = %%-python-select-options-element-%%
|
||
|
### param: ElementHandle.selectOption.index = %%-python-select-options-index-%%
|
||
|
### param: ElementHandle.selectOption.value = %%-python-select-options-value-%%
|
||
|
### param: ElementHandle.selectOption.label = %%-python-select-options-label-%%
|
||
|
|
||
|
### param: Frame.selectOption.element = %%-python-select-options-element-%%
|
||
|
### param: Frame.selectOption.index = %%-python-select-options-index-%%
|
||
|
### param: Frame.selectOption.value = %%-python-select-options-value-%%
|
||
|
### param: Frame.selectOption.label = %%-python-select-options-label-%%
|
||
|
|
||
|
### param: Page.selectOption.element = %%-python-select-options-element-%%
|
||
|
### param: Page.selectOption.index = %%-python-select-options-index-%%
|
||
|
### param: Page.selectOption.value = %%-python-select-options-value-%%
|
||
|
### param: Page.selectOption.label = %%-python-select-options-label-%%
|