20 lines
770 B
Python
20 lines
770 B
Python
import asyncio
|
|
from playwright.async_api import async_playwright
|
|
|
|
async def run_whale_headless():
|
|
whale_path = "C:\\Program Files\\Naver\\Naver Whale\\Application\\whale.exe"
|
|
|
|
async with async_playwright() as p:
|
|
browser = await p.chromium.launch_persistent_context(
|
|
user_data_dir="C:/path/to/whale_user_data", # 브라우저 사용자 데이터 폴더 경로
|
|
executable_path=whale_path,
|
|
headless=True, # 헤드리스 모드 활성화
|
|
args=["--remote-debugging-port=9222"] # DevTools Protocol 사용
|
|
)
|
|
page = await browser.new_page()
|
|
await page.goto("https://www.percenty.co.kr/")
|
|
print(await page.title())
|
|
await browser.close()
|
|
|
|
asyncio.run(run_whale_headless())
|