From 64906017c4d9a06c08a424b12331c4480ed2797e Mon Sep 17 00:00:00 2001 From: Jaewook Lee <11328376+jaewooklee93@users.noreply.github.com> Date: Sat, 10 Aug 2024 03:58:44 +0900 Subject: [PATCH] playwright: initial example --- playwright/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 playwright/README.md diff --git a/playwright/README.md b/playwright/README.md new file mode 100644 index 0000000..55fca87 --- /dev/null +++ b/playwright/README.md @@ -0,0 +1,28 @@ +```python +# pip install playwright && playwright install --with-deps chromium + +def GET(url): + html = __import__('queue').Queue() + def tGET(): + async def aGET(): + from playwright.async_api import async_playwright + async with async_playwright() as playwright: + browser = await playwright.chromium.launch() + page = await browser.new_page() + html.put(await page.goto(url) and await page.content()) + __import__('asyncio').run(aGET()) + __import__('threading').Thread(target=tGET).start() + return html.get() + +# 사용 예 +html = GET('https://www.freeproxy.world/') +print(html) + +# Output: +""" + + + +FreeProxy.World - Free Proxy List +""" +``` \ No newline at end of file