mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 03:51:52 +09:00
[Enhancement] GetProfile 함수 추가 및 브라우저 프로필 생성 로직 통합
This commit is contained in:
parent
b49fe8b49e
commit
adec1f5e49
2 changed files with 26 additions and 22 deletions
|
|
@ -5,24 +5,28 @@ proxy_url = setup_proxy()
|
||||||
storage_state_path = setup_storage_state()
|
storage_state_path = setup_storage_state()
|
||||||
|
|
||||||
# Create browser profile
|
# Create browser profile
|
||||||
profile = BrowserProfile(
|
def GetProfile():
|
||||||
# Security settings
|
setup_storage_state()
|
||||||
disable_security=True,
|
profile = BrowserProfile(
|
||||||
stealth=True,
|
# Security settings
|
||||||
|
disable_security=True,
|
||||||
# Display settings
|
stealth=True,
|
||||||
headless=False,
|
|
||||||
device_scale_factor=1,
|
# Display settings
|
||||||
window_size={"width": 1600, "height": 900},
|
headless=False,
|
||||||
viewport={"width": 1600, "height": 900},
|
device_scale_factor=1,
|
||||||
|
window_size={"width": 1600, "height": 900},
|
||||||
# Data persistence
|
viewport={"width": 1600, "height": 900},
|
||||||
user_data_dir=None,
|
|
||||||
storage_state=storage_state_path,
|
# Data persistence
|
||||||
|
user_data_dir=None,
|
||||||
# Network settings
|
storage_state=storage_state_path,
|
||||||
proxy={"server": proxy_url} if proxy_url else None,
|
|
||||||
|
# Network settings
|
||||||
# Additional arguments
|
proxy={"server": proxy_url} if proxy_url else None,
|
||||||
args=get_browser_args(),
|
|
||||||
)
|
# Additional arguments
|
||||||
|
args=get_browser_args(),
|
||||||
|
)
|
||||||
|
|
||||||
|
return profile
|
||||||
2
main.py
2
main.py
|
|
@ -103,7 +103,7 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
||||||
# BrowserSession에 profile 전달
|
# BrowserSession에 profile 전달
|
||||||
session = BrowserSession(
|
session = BrowserSession(
|
||||||
playwright=(await async_patchright().start()),
|
playwright=(await async_patchright().start()),
|
||||||
browser_profile=browser_use.profile,
|
browser_profile=browser_use.GetProfile(),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Agent 생성 및 실행 (단일 try-except with 백오프)
|
# Agent 생성 및 실행 (단일 try-except with 백오프)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue