[Enhancement] GetProfile 함수 추가 및 브라우저 프로필 생성 로직 통합

This commit is contained in:
imnyang 2025-06-15 22:36:20 +09:00
commit adec1f5e49
2 changed files with 26 additions and 22 deletions

View file

@ -5,7 +5,9 @@ proxy_url = setup_proxy()
storage_state_path = setup_storage_state()
# Create browser profile
profile = BrowserProfile(
def GetProfile():
setup_storage_state()
profile = BrowserProfile(
# Security settings
disable_security=True,
stealth=True,
@ -25,4 +27,6 @@ profile = BrowserProfile(
# Additional arguments
args=get_browser_args(),
)
)
return profile

View file

@ -103,7 +103,7 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
# BrowserSession에 profile 전달
session = BrowserSession(
playwright=(await async_patchright().start()),
browser_profile=browser_use.profile,
browser_profile=browser_use.GetProfile(),
)
# Agent 생성 및 실행 (단일 try-except with 백오프)