Skip to main content

Capsolver Extension Python

Capsolver Extension Python helps you easily use Capsolver Extension in Botasaurus, Selenium, and Playwright.

You can easily configure Capsolver with an API key without needing to download the Capsolver Extension, update config files, etc.

Installation

python -m pip install capsolver_extension_python

Usage with Botasaurus Web Scraping Framework

from botasaurus.browser import browser, Driver
from capsolver_extension_python import Capsolver

@browser(
    extensions=[Capsolver(api_key="CAP-MY_KEY")], # TODO: Replace with your own CapSolver Key
)  
def solve_captcha(driver: Driver, data):
    driver.get("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php")
    driver.prompt()

solve_captcha()

Usage with Selenium

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from chromedriver_autoinstaller import install
from capsolver_extension_python import Capsolver

# Set Chrome options
options = Options()
options.add_argument(Capsolver(api_key="CAP-MY_KEY").load()) # TODO: Replace with your own CapSolver Key
# Install and set up the driver
driver_path = install()
driver = webdriver.Chrome(driver_path, options=options)

# Navigate to the desired URL
driver.get("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php")

# Prompt for user input
input("Press Enter to exit...")

# Clean up
driver.quit()

Usage with Playwright

from playwright.sync_api import sync_playwright
from capsolver_extension_python import Capsolver
import random

def generate_random_profile():
    return str(random.randint(1, 1000))

with sync_playwright() as p:
    extension_path = Capsolver(api_key="CAP-MY_KEY").load(with_command_line_option=False) # TODO: Replace with your own CapSolver Key
    browser = p.chromium.launch_persistent_context(
        user_data_dir=generate_random_profile(),
        headless=False,
        args=[
            '--disable-extensions-except='+ extension_path,
            '--load-extension=' + extension_path,
        ],
    )
    page = browser.new_page()
    page.goto("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php")
    input("Press Enter to exit...")
    browser.close()

Use App ID

from botasaurus.browser import browser, Driver
from capsolver_extension_python import Capsolver

@browser(
    extensions=[Capsolver(api_key="CAP-MY_KEY", app_id="DC601421-43D5-45E4-9FDB-B3BAF7A2C3FD")], # TODO: Replace with your own CapSolver Key and App ID
)  
def solve_captcha(driver: Driver, data):
    driver.get("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php")
    driver.prompt()

solve_captcha()

Note

When you use the Capsolver Extension, we integrate our own app ID into the extension if you haven't provided one. This allows us to earn a small commission from each captcha you solve, at no extra cost to you.

These funds supports us in our efforts to develop awesome open-source projects to make your life easy.

Love It? Star It ⭐!

Become one of our amazing stargazers by giving us a star ⭐ on GitHub!

It's just one click, but it means the world to me.

Stargazers for @omkarcloud/capsolver-extension-python

Metadata

Release files for capsolver-extension-python 1.0.3

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

Source distribution (sdist)

Source distribution for capsolver-extension-python 1.0.3
File Size Uploaded
capsolver_extension_python-1.0.3.tar.gz 4.3 kB Details

Release files / capsolver_extension_python-1.0.3.tar.gz

Download URL capsolver_extension_python-1.0.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
19668bbba8d02a04a5ea9cc184b3366e9281b7ce56e31e34455e53ba222b99b3
BLAKE2b-256 checksum
How to use checksums
a12cd6e1b5fb99a342af7893c13f932e66106a0e361fa508821d78e7445ccc8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

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