Skip to main content

Browseek: Advanced Multi-Browser Automation Library

Browseek is a sophisticated Python library designed for advanced multi-task and multi-browser automation. It provides a robust solution for managing complex web automation scenarios, including request redirection, DNS security, CAPTCHA handling, device simulation, and fine-grained network control.

Table of Contents

Installation

pip install browseek

Quick Start

from browseek import BrowserRouter

# Initialize the router
router = BrowserRouter()

# Add browser instances
router.add_browser("chrome", count=2)
router.add_browser("firefox", count=1)

# Use the router to perform a task
result = router.execute("https://example.com", lambda page: page.title())
print(result)

# Clean up
router.close()

Getting Started with Docker

To start the Browseek library using Docker, please refer to the DOCKER.md file for detailed instructions.

Core Concepts

  • BrowserRouter: The main class for managing browser instances and routing requests.
  • BrowserInstance: Represents a single headless browser instance.
  • Route: Defines rules for how specific requests should be handled.
  • Task: A unit of work to be executed in a browser instance.

API Reference

BrowserRouter

class BrowserRouter:
    def __init__(self, config: Dict[str, Any] = None):
        """Initialize the BrowserRouter with optional configuration."""

    def add_browser(self, browser_type: str, count: int = 1, options: Dict[str, Any] = None):
        """Add browser instances to the router."""

    def remove_browser(self, browser_id: str):
        """Remove a browser instance from the router."""

    def add_route(self, pattern: str, handler: Callable):
        """Add a route for specific URL patterns."""

    def execute(self, url: str, task: Callable, timeout: int = 30):
        """Execute a task on a suitable browser instance."""

    def close(self):
        """Close all browser instances and clean up resources."""

BrowserInstance

class BrowserInstance:
    def __init__(self, browser_type: str, options: Dict[str, Any] = None):
        """Initialize a browser instance."""

    def navigate(self, url: str):
        """Navigate to a specific URL."""

    def execute_script(self, script: str):
        """Execute JavaScript in the browser context."""

    def take_screenshot(self) -> bytes:
        """Capture a screenshot of the current page."""

Configuration

Browseek can be configured via a Python dictionary or a YAML file:

config = {
    "max_concurrent_browsers": 5,
    "default_timeout": 30,
    "retry_attempts": 3,
    "proxy": {
        "enabled": True,
        "rotate_on_failure": True
    }
}

router = BrowserRouter(config)

Examples

For detailed examples of how to use Browseek for various scenarios, please refer to the EXAMPLES.md file.

Contributing

We welcome contributions to Browseek! Please see our Contributing Guide for more information on how to get started.

Testing

Browseek uses the unittest framework for testing. For information on running tests and writing new tests, please refer to the TESTING.md file.

Changelog

For a detailed list of changes and version history, please see the CHANGELOG.md file.

Metadata

Release files for browseek 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for browseek 0.1.7
File Size Uploaded
browseek-0.1.7.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for browseek 0.1.7
File Interpreter ABI Platform
browseek-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / browseek-0.1.7.tar.gz

Download URL browseek-0.1.7.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
892915d60cee4403003664d9146e112483619e3c413710d7619b5a2b8a6f490a
BLAKE2b-256 checksum
How to use checksums
d658e3f9c39c27b8f7b04aab6a7febf7605299a02f007e84aaec49a7b50307a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release files / browseek-0.1.7-py3-none-any.whl

Download URL browseek-0.1.7-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb4ea027756493a211c4c571137749b276d002e2ca879c7630854ea3d924ebc5
BLAKE2b-256 checksum
How to use checksums
0b5902a836fad81fe511086efed912811cf5b6f0e8b3979f7218bde15dda5a3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page