This commit is contained in:
a2a-platform
2026-06-27 16:21:11 +00:00
parent 74d0b664fc
commit 1958c539fc
3 changed files with 22 additions and 5 deletions

View File

@@ -127,7 +127,7 @@ class BrowserToApiAgent(A2AAgent[BrowserToApiConfig, NoAuth]):
"SeleniumBase-style browser agent that turns observed website traffic "
"into OpenAPI specs, coverage reports, samples, and a replay client."
)
version = "0.2.2"
version = "0.2.3"
config_model = BrowserToApiConfig
auth_model = NoAuth
@@ -394,7 +394,7 @@ def seleniumbase_stealth_prep(
return [], [f"seleniumbase warning: import failed: {type(exc).__name__}: {exc}"]
try:
with SB(uc=True, test=True, locale="en-US", use_chromium=True) as sb:
with SB(**_seleniumbase_options()) as sb:
log.append("seleniumbase: started UC/CDP stealth session")
try:
sb.uc_open_with_reconnect(url, reconnect_time=3)
@@ -435,6 +435,22 @@ def seleniumbase_stealth_prep(
return cookies, log
def _seleniumbase_options() -> dict[str, Any]:
options: dict[str, Any] = {
"uc": True,
"test": True,
"locale": "en-US",
"xvfb": True,
"chromium_arg": "--no-sandbox,--disable-dev-shm-usage,--disable-gpu",
}
system_chromium = _system_chromium_path()
if system_chromium:
options["binary_location"] = system_chromium
else:
options["use_chromium"] = True
return options
def _seleniumbase_sleep(sb: Any, seconds: int) -> None:
try:
sb.sleep(seconds)