Update playwright/README.md
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
```python
|
```python
|
||||||
# play.py
|
# play.py
|
||||||
from playwright.async_api import async_playwright as aP
|
from playwright.async_api import async_playwright as aP
|
||||||
import xvfbwrapper, io, os
|
import xvfbwrapper, io, os, asyncio
|
||||||
from db import DB
|
from db import DB
|
||||||
|
|
||||||
async def Page(browser='chromium', headless=True):
|
async def Page(browser='chromium', headless=True):
|
||||||
@@ -34,6 +34,7 @@ async def main():
|
|||||||
page = await Page()
|
page = await Page()
|
||||||
await page.goto('https://naver.com')
|
await page.goto('https://naver.com')
|
||||||
await page.screenshot(path='screenshot.png')
|
await page.screenshot(path='screenshot.png')
|
||||||
|
await asyncio.sleep(1) # 1초 대기 추가
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|||||||
Reference in New Issue
Block a user