deploy
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"language": "python",
|
||||
"name": "seleniumbase-website-scraper",
|
||||
"description": "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",
|
||||
"entrypoint": {
|
||||
"module": "agent",
|
||||
"class_name": "BrowserToApiAgent",
|
||||
@@ -364,7 +364,7 @@
|
||||
"source": "python-a2a-pack",
|
||||
"project_manifest": {
|
||||
"name": "seleniumbase-website-scraper",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"entrypoint": "agent:BrowserToApiAgent"
|
||||
}
|
||||
}
|
||||
|
||||
3
a2a.yaml
3
a2a.yaml
@@ -1,5 +1,5 @@
|
||||
name: seleniumbase-website-scraper
|
||||
version: 0.2.2
|
||||
version: 0.2.3
|
||||
entrypoint: agent:BrowserToApiAgent
|
||||
expose:
|
||||
public: true
|
||||
@@ -38,4 +38,5 @@ runtime:
|
||||
- libxfixes3
|
||||
- libxkbcommon0
|
||||
- libxrandr2
|
||||
- xvfb
|
||||
- xdg-utils
|
||||
|
||||
20
agent.py
20
agent.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user