deploy
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "seleniumbase-website-scraper",
|
"name": "seleniumbase-website-scraper",
|
||||||
"description": "SeleniumBase-style browser agent that turns observed website traffic into OpenAPI specs, coverage reports, samples, and a replay client.",
|
"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": {
|
"entrypoint": {
|
||||||
"module": "agent",
|
"module": "agent",
|
||||||
"class_name": "BrowserToApiAgent",
|
"class_name": "BrowserToApiAgent",
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
"source": "python-a2a-pack",
|
"source": "python-a2a-pack",
|
||||||
"project_manifest": {
|
"project_manifest": {
|
||||||
"name": "seleniumbase-website-scraper",
|
"name": "seleniumbase-website-scraper",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"entrypoint": "agent:BrowserToApiAgent"
|
"entrypoint": "agent:BrowserToApiAgent"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
a2a.yaml
3
a2a.yaml
@@ -1,5 +1,5 @@
|
|||||||
name: seleniumbase-website-scraper
|
name: seleniumbase-website-scraper
|
||||||
version: 0.2.2
|
version: 0.2.3
|
||||||
entrypoint: agent:BrowserToApiAgent
|
entrypoint: agent:BrowserToApiAgent
|
||||||
expose:
|
expose:
|
||||||
public: true
|
public: true
|
||||||
@@ -38,4 +38,5 @@ runtime:
|
|||||||
- libxfixes3
|
- libxfixes3
|
||||||
- libxkbcommon0
|
- libxkbcommon0
|
||||||
- libxrandr2
|
- libxrandr2
|
||||||
|
- xvfb
|
||||||
- xdg-utils
|
- 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 "
|
"SeleniumBase-style browser agent that turns observed website traffic "
|
||||||
"into OpenAPI specs, coverage reports, samples, and a replay client."
|
"into OpenAPI specs, coverage reports, samples, and a replay client."
|
||||||
)
|
)
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
|
|
||||||
config_model = BrowserToApiConfig
|
config_model = BrowserToApiConfig
|
||||||
auth_model = NoAuth
|
auth_model = NoAuth
|
||||||
@@ -394,7 +394,7 @@ def seleniumbase_stealth_prep(
|
|||||||
return [], [f"seleniumbase warning: import failed: {type(exc).__name__}: {exc}"]
|
return [], [f"seleniumbase warning: import failed: {type(exc).__name__}: {exc}"]
|
||||||
|
|
||||||
try:
|
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")
|
log.append("seleniumbase: started UC/CDP stealth session")
|
||||||
try:
|
try:
|
||||||
sb.uc_open_with_reconnect(url, reconnect_time=3)
|
sb.uc_open_with_reconnect(url, reconnect_time=3)
|
||||||
@@ -435,6 +435,22 @@ def seleniumbase_stealth_prep(
|
|||||||
return cookies, log
|
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:
|
def _seleniumbase_sleep(sb: Any, seconds: int) -> None:
|
||||||
try:
|
try:
|
||||||
sb.sleep(seconds)
|
sb.sleep(seconds)
|
||||||
|
|||||||
Reference in New Issue
Block a user