How to solve FunCaptcha using Selenium [Python] with Capsolver Extension

How to solve FunCaptcha using Selenium [Python] with Capsolver Extension

Logo of Capsolver

CapSolver Blogger

How to use capsolver


Solving FunCaptcha Using Selenium and Capsolver Extension

In this blog, we'll guide you through the process of setting up Selenium with the Capsolver extension to solve FunCaptcha. This method can also be applied to other types of captchas.

1. Installing Selenium and Required Components

First, you need to install Selenium and other necessary components. You can do this using pip:

pip install selenium

Make sure you have the appropriate drivers for the browser you intend to use (e.g., ChromeDriver for Google Chrome, GeckoDriver for Firefox).

2. Configuring the Capsolver Extension

Download the Capsolver extension from here. Unzip it into the ./CapSolver.Browser.Extension directory at the root of your project.

The extension offers various settings, including automatic captcha solving, proxy support, and more. These settings are located in ./assets/config.json. Here's an example of the configuration:

  "apiKey": "YourApiKey",
  "useCapsolver": true,
  "useProxy": false,
  "proxyType": "http",
  "hostOrIp": "",
  "port": "",
  "proxyLogin": "",
  "proxyPassword": "",
  "enabledForBlacklistControl": false,
  "blackUrlList": [],
  "enabledForRecaptcha": false,
  "enabledForRecaptchaV3": false,
  "enabledForHCaptcha": false,
  "enabledForFunCaptcha": true,
  "funCaptchaMode": "token",
  "reCaptchaDelayTime": 0,
  "hCaptchaDelayTime": 0,
  "reCaptchaRepeatTimes": 0,
  "reCaptcha3RepeatTimes": 0,
  "hCaptchaRepeatTimes": 0,
  "funCaptchaRepeatTimes": 10

Insert your API key in the apiKey field in ./assets/config.json. You can find your API key on the Capsolver page.

For this example, we'll use the funCaptchaMode set to token.

3. Setting Up Selenium to Solve FunCaptcha with Capsolver Extension

First, you need to set up Selenium WebDriver and configure it to use the Capsolver extension. Here's an example using ChromeDriver in Python:

from selenium import webdriver
from import Options
from import By
from import WebDriverWait
from import expected_conditions as EC
import os

def main():
    extension_path = os.path.abspath('./CapSolver.Browser.Extension')
    chrome_options = Options()

    driver = webdriver.Chrome(options=chrome_options)
    driver.get('')  # Adjust this URL to your FunCaptcha test page

    # Wait for the FunCaptcha to be solved automatically by the extension
    WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'button.submit-button')))  # Adjust the selector as needed

    # Here, you can proceed with your form submission or any other actions post-captcha solving


if __name__ == "__main__":

Full Code:

The provided Python script is complete and ready to run. Ensure you've correctly set up your environment with the required packages and drivers, and don't forget to adjust the extension_path as necessary to point to your Capsolver extension directory.

And that's it! You have successfully solved FunCaptcha using the Capsolver Extension and Selenium in Python. To solve other types of captchas, simply follow the same steps and adjust accordingly.

Capsolver Team 💜