mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
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)
|
||||
# Execute login steps manually in the browser window
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
```python sync
|
||||
|
||||
@ -296,7 +296,7 @@ async def main():
|
||||
# Works across chromium, firefox and webkit
|
||||
browser = await p.chromium.launch(headless=False)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
```python sync
|
||||
|
||||
@ -17,8 +17,8 @@ $ npx playwright --help
|
||||
$ python -m playwright
|
||||
```
|
||||
|
||||
Running from `package.json` script
|
||||
```json
|
||||
```json js
|
||||
# Running from `package.json` script
|
||||
{
|
||||
"scripts": {
|
||||
"help": "playwright --help"
|
||||
|
||||
@ -38,7 +38,7 @@ async def main():
|
||||
browser = await p.chromium.launch(headless=False)
|
||||
await browser.close()
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
```python sync
|
||||
@ -113,7 +113,7 @@ async def main():
|
||||
page = await browser.newPage()
|
||||
await browser.close()
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
```python sync
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user