scitex_browser.remote
Remote browser components (ZenRows, CAPTCHA handling).
- class scitex_browser.remote.ZenRowsAPIBrowser(api_key=None, proxy_country='au', enable_antibot=True, premium_proxy=True)[source]
Bases:
objectBrowser-like interface using ZenRows API for page rendering.
This provides a simpler, more reliable alternative to WebSocket-based browser connections. It’s especially good for: - Taking screenshots - Handling CAPTCHAs automatically - Getting rendered HTML content - Bypassing anti-bot measures
- __init__(api_key=None, proxy_country='au', enable_antibot=True, premium_proxy=True)[source]
Initialize ZenRows API browser.
Navigate to URL and optionally take screenshot.
- Parameters:
- Return type:
- Returns:
Dict with results including screenshot info and HTML
- class scitex_browser.remote.ZenRowsRemoteScholarBrowserManager(auth_manager=None, zenrows_api_key=None, proxy_country=None, **kwargs)[source]
Bases:
objectManages a connection to the remote ZenRows Scraping Browser service.
- __init__(auth_manager=None, zenrows_api_key=None, proxy_country=None, **kwargs)[source]
Initialize ZenRows browser manager.
- async get_authenticated_browser_and_context_async()[source]
Get browser context with authentication cookies pre-loaded.
- Return type:
tuple[Browser,BrowserContext]
- async take_screenshot_reliable_async(url, output_path, use_api=True, wait_ms=5000)[source]
Take a screenshot with automatic CAPTCHA handling.
This method provides reliable screenshot capture by: 1. Using the API approach by default (more reliable) 2. Falling back to WebSocket browser if needed 3. Automatically handling CAPTCHAs via ZenRows
Navigate to URL and extract information.
This combines navigation, screenshot, and data extraction. Uses the API approach for better reliability.
- class scitex_browser.remote.CaptchaHandler(api_key=None)[source]
Bases:
objectHandles CAPTCHA solving using 2Captcha service.
- async handle_page_async(page)[source]
Check and handle captcha on the current page.
- Returns:
True if captcha was found and solved, False otherwise
- Return type:
- async _is_cloudflare_challenge_async(page)[source]
Check if this is a Cloudflare challenge.
- Return type:
- async _solve_cloudflare_challenge_async(page)[source]
Handle Cloudflare challenge/turnstile.
- Return type: