Documentation

Python SDK

Official Python SDK for the Browser Cloud API. A high-level interface for controlling cloud browsers, executing JavaScript, and managing browser sessions.

Installation

Install the Browser Cloud Python SDK using the hosted package index:

Install: python3 -m pip install --extra-index-url https://wrc-beta.xyz/simple wrc_py

Upgrade: python3 -m pip install --upgrade --force-reinstall --no-cache-dir --extra-index-url https://wrc-beta.xyz/simple wrc_py

Quick Start

Here's a simple example to get you started:

from wrc_py import rent_browser
 
 def run():
     # Rent a browser session
     browser = rent_browser(
         "your-api-key",
         300,  # rent time in seconds (5 minutes)
         "",   # proxy host (required)
         0,    # proxy port (required)
         "",   # proxy username (optional)
         "",   # proxy password (optional)
         "",   # country code (optional, "" for auto)
         "",   # timezone (optional, "" for auto)
         "",   # blob name for static files (optional)
     )
 
     try:
         # Navigate to a page
         browser.navigate("https://example.com", 30000)
 
         # Wait for an element to appear in the main frame
         browser.wait_for_selector(
             'a[href="https://iana.org/domains/example"]',
             30000,
         )
 
         # Click an element
         browser.click_selector('a[href="https://iana.org/domains/example"]')
 
         print("Success!")
     finally:
         browser.stop_browser()
 
 run()

Features

  • Browser Automation: Navigate, click elements, and interact with web pages
  • JavaScript Execution: Run JavaScript code in browser contexts
  • Frame Management: Work with multiple frames and iframes
  • Request/Response Interception: Monitor and modify network requests
  • Static File Injection: Upload and serve custom static files
  • Session Management: Handle authentication and session persistence
  • Cookie Management: Get, set, and clear cookies
  • Captcha Solving: Solve supported captchas (PerimeterX, Cloudflare Turnstile, DataDome)

Next Steps

For complete API documentation including all types, functions, parameters, and return values, see the API Reference.

View API Reference →