fix: v0.5.11 - Corrected sandbox parameter name to sandbox=False for Zendriver v0.15.2
This commit is contained in:
53
zd_debug.py
53
zd_debug.py
@@ -3,29 +3,48 @@ import asyncio
|
||||
import zendriver as zd
|
||||
import sys
|
||||
import os
|
||||
import inspect
|
||||
|
||||
async def test():
|
||||
print("Testing Zendriver Startup...")
|
||||
print(f"EUID: {os.geteuid()}")
|
||||
|
||||
# Check what parameters zendriver Config accepts
|
||||
config = zd.Config()
|
||||
print(f"Default Config no_sandbox: {getattr(config, 'no_sandbox', 'N/A')}")
|
||||
print("=== Zendriver API Inspection ===")
|
||||
|
||||
# Inspect zd.start
|
||||
print("\n--- zd.start Signature ---")
|
||||
try:
|
||||
# Try starting with explicit args
|
||||
print("Attempting to start browser with no_sandbox=True and explicit --no-sandbox arg...")
|
||||
browser = await zd.start(
|
||||
headless=True,
|
||||
no_sandbox=True,
|
||||
browser_args=["--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu"]
|
||||
)
|
||||
print("Success! Browser started.")
|
||||
sig = inspect.signature(zd.start)
|
||||
print(sig)
|
||||
for param in sig.parameters.values():
|
||||
print(f" {param.name}: {param.default}")
|
||||
except Exception as e:
|
||||
print(f"Failed to inspect zd.start: {e}")
|
||||
|
||||
# Inspect zd.Config
|
||||
print("\n--- zd.Config Attributes ---")
|
||||
try:
|
||||
config = zd.Config()
|
||||
# Filter out dunder methods
|
||||
attrs = [a for a in dir(config) if not a.startswith("__")]
|
||||
print(attrs)
|
||||
|
||||
# Check current values
|
||||
for a in attrs:
|
||||
try:
|
||||
val = getattr(config, a)
|
||||
if not callable(val):
|
||||
print(f" {a} = {val}")
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f"Failed to inspect zd.Config: {e}")
|
||||
|
||||
print("\n--- Testing Config 3: 'arguments' instead of 'browser_args' ---")
|
||||
try:
|
||||
# Based on typical Zendriver usage, it might be 'arguments'
|
||||
browser = await zd.start(headless=True, no_sandbox=True, arguments=["--no-sandbox", "--disable-dev-shm-usage"])
|
||||
print("Success with Config 3 (arguments)!")
|
||||
await browser.stop()
|
||||
except Exception as e:
|
||||
print(f"Failed to start: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print(f"Config 3 (arguments) Failed: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(test())
|
||||
|
||||
Reference in New Issue
Block a user