docs: brush up some python docs (#5027)
This commit is contained in:
parent
b45905ae3f
commit
56ba0b3cd9
|
|
@ -227,7 +227,7 @@ async def main():
|
||||||
browser = await p.chromium.launch_persistent_context(userDataDir, headless=False)
|
browser = await p.chromium.launch_persistent_context(userDataDir, headless=False)
|
||||||
# Execute login steps manually in the browser window
|
# Execute login steps manually in the browser window
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(main())
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
```python sync
|
```python sync
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ async def main():
|
||||||
# Works across chromium, firefox and webkit
|
# Works across chromium, firefox and webkit
|
||||||
browser = await p.chromium.launch(headless=False)
|
browser = await p.chromium.launch(headless=False)
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(main())
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
```python sync
|
```python sync
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ $ npx playwright --help
|
||||||
$ python -m playwright
|
$ python -m playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
Running from `package.json` script
|
```json js
|
||||||
```json
|
# Running from `package.json` script
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"help": "playwright --help"
|
"help": "playwright --help"
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ async def main():
|
||||||
browser = await p.chromium.launch(headless=False)
|
browser = await p.chromium.launch(headless=False)
|
||||||
await browser.close()
|
await browser.close()
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(main())
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
```python sync
|
```python sync
|
||||||
|
|
@ -113,7 +113,7 @@ async def main():
|
||||||
page = await browser.newPage()
|
page = await browser.newPage()
|
||||||
await browser.close()
|
await browser.close()
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(main())
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
```python sync
|
```python sync
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue