How to bypass Click Сaptcha
Introduction
Click Captcha (also known as coordinate captcha) is a type of verification where the user is asked to click on an image according to instructions: "Click on the green apple", "Select all traffic lights", or "Click in the specified order". Such captchas are used on many websites to protect against bots, but they create challenges for automation.
In this guide, we will explore how to automatically solve Click Captcha using our service with the coordinate method. You will learn:
- How coordinate captcha works
- Which parameters are required to submit a task
- How to integrate the solution into your Python script
- How to parse response coordinates and emulate clicks
- What errors may occur and how to fix them
What is Click Captcha
| Characteristic | Description |
|---|---|
| Task Type | Click on specific points on an image |
| Input Data | Captcha image + text/visual instruction |
| Solution Result | Array of coordinates x=...,y=... for clicks |
| Complexity | Medium — requires precise cursor positioning |
Click Captcha visually resembles reCAPTCHA V2, but differs in mechanics: instead of selecting objects from a grid, you need to click on specific pixels within a single image.
Preparation: Required Parameters
| Parameter | Required | Description |
|---|---|---|
| type | Yes | Task type: CoordinatesTask |
| body | Yes | Captcha image in base64 or file path |
| imgInstructions | No | Image with visual hint (optional) |
| comment | No | Text instruction, e.g., "Click on the green apple" |
| minClicks and maxClicks | No | Minimum and maximum number of clicks allowed |
| clientKey | Yes | Your API key |
Tip: Always specify the comment parameter — this improves recognition accuracy.
Step by step guide: solving via API
Step 1: Get the captcha image
Use Selenium, Puppeteer, or any HTTP client to load the image:
python
from selenium.webdriver.common.by import By
from PIL import Image
import requests
# Find the captcha element
img_url = driver.find_element(By.CSS_SELECTOR, "img[alt='clickcaptcha example']").get_attribute('src')
# Download and save the image
img = Image.open(requests.get(img_url, stream=True).raw)
img.save('captcha.png')
Step 2: Submit the task for solving
API v2 Endpoint: https://api.2captcha.com/createTask
Example Request (JSON):
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "CoordinatesTask",
"body": "iVBORw0KGgoAAAANSUhEUgAA...",
"textinstructions": "Click on the green apple",
"imginstructions": "base64_hint_image_optional",
"lang": "en"
}
}
Or via Python SDK:
python
from twocaptcha import TwoCaptcha
solver = TwoCaptcha('YOUR_API_KEY', defaultTimeout=120, pollingInterval=5)
try:
result = solver.coordinates('captcha.png',
textinstructions='Click on the green apple',
lang='en')
except Exception as e:
print(f"Error: {e}")
else:
print(f"Solved: {result}")
Step 3: Get the result
The service response contains coordinates in the following format:
coordinates:x=187,y=60;x=98,y=121;x=267,y=115
Parse the response:
python
# result['code'] = "coordinates:x=187,y=60;x=98,y=121;x=267,y=115"
coordinates_raw = result['code'].replace('coordinates:', '').split(';')
coordinates = []
for coord in coordinates_raw:
x, y = coord.split('=')[1].split(',')
coordinates.append({'x': int(x), 'y': int(y)})
# coordinates = [{'x': 187, 'y': 60}, {'x': 98, 'y': 121}, {'x': 267, 'y': 115}]
Step 4: Emulate clicks by coordinates
Important: Coordinates in the response are relative — counting starts from the top-left corner of the captcha image.
python
from selenium.webdriver.common.action_chains import ActionChains
# Find the captcha element on the page and get its position
captcha_el = driver.find_element(By.CSS_SELECTOR, "img[alt='clickcaptcha example']")
captcha_location = captcha_el.location # {'x': 150, 'y': 300}
# Click on each coordinate
for coord in coordinates:
ActionChains(driver)\
.move_to_element_with_offset(captcha_el, coord['x'], coord['y'])\
.click()\
.perform()
# Small pause between clicks for natural behavior
time.sleep(0.3)
Tip: After each click, reset actions via
ActionChains(driver).reset_actions()to avoid accumulating offsets.
Step 5: Confirm the solution
After performing all clicks, press the verification button (Submit/Check):
python
driver.find_element(By.CSS_SELECTOR, "button[type='submit']").click()
Complete Python example
python
import time
import requests
from PIL import Image
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from twocaptcha import TwoCaptcha
# === Settings ===
API_KEY = 'YOUR_API_KEY'
TARGET_URL = 'https://example.com/page-with-captcha'
CAPTCHA_SELECTOR = "img[alt='clickcaptcha example']"
SUBMIT_SELECTOR = "button[type='submit']"
# === Initialization ===
driver = webdriver.Chrome()
solver = TwoCaptcha(API_KEY, defaultTimeout=120, pollingInterval=5)
try:
# 1. Open the page
driver.get(TARGET_URL)
time.sleep(3)
# 2. Download the captcha image
img_url = driver.find_element(By.CSS_SELECTOR, CAPTCHA_SELECTOR).get_attribute('src')
img = Image.open(requests.get(img_url, stream=True).raw)
img.save('captcha.png')
# 3. Submit for solving
result = solver.coordinates(
'captcha.png',
textinstructions='Click on the green apple', # Adapt to your captcha!
lang='en'
)
# 4. Parse coordinates
coords_raw = result['code'].replace('coordinates:', '').split(';')
coordinates = []
for c in coords_raw:
x, y = c.replace('x=', '').replace('y=', '').split(',')
coordinates.append({'x': int(x), 'y': int(y)})
# 5. Click on coordinates
captcha_el = driver.find_element(By.CSS_SELECTOR, CAPTCHA_SELECTOR)
for coord in coordinates:
ActionChains(driver)\
.move_to_element_with_offset(captcha_el, coord['x'], coord['y'])\
.click()\
.perform()
time.sleep(0.3)
ActionChains(driver).reset_actions()
# 6. Confirm
driver.find_element(By.CSS_SELECTOR, SUBMIT_SELECTOR).click()
print("✅ Captcha solved successfully!")
# Keep browser open for verification
time.sleep(10)
except Exception as e:
print(f"❌ Error: {e}")
finally:
# driver.quit() # Uncomment for automatic closure
pass
Error handling and recommendations
Common errors
| Error Code | Cause | Solution |
|---|---|---|
| ERROR_WRONG_USER_KEY | Invalid API key | Check your key in the dashboard |
| ERROR_ZERO_BALANCE | Insufficient funds | Top up your account balance |
| ERROR_CAPTCHA_UNSOLVABLE | Captcha not recognized | Specify comment, check image quality |
| ERROR_BAD_PARAMETERS | Invalid task parameters | Verify body format (base64) and required fields |
Tips for improving success rate
- Always specify an instruction — they are critical for accuracy.
- Add delays between actions — emulating "human" behavior reduces blocking risk.
- Check element position — response coordinates are relative; account for captcha offset on the page.
- Implement retry logic — on ERROR_CAPTCHA_UNSOLVABLE, try resubmitting the task with a refined instruction.
Request rate control
python
# Exponential backoff for retry attempts
def solve_with_retry(solver, image_path, instruction, max_retries=3):
for attempt in range(max_retries):
try:
return solver.coordinates(image_path, textinstructions=instruction, lang='en')
except Exception as e:
if attempt == max_retries - 1:
raise
wait_time = 5 * (2 ** attempt) # 5s, 10s, 20s
print(f"Attempt {attempt + 1} failed. Waiting {wait_time}s...")
time.sleep(wait_time)
Useful links
Conclusion
ClickCaptcha is an effective protection mechanism that can be sensitive to implementation quality and interaction conditions. Key factors for reliable operation of automated testing scenarios include:
- Correct extraction and processing of images in the interface
- Accurate interpretation of user instructions (comment)
- Careful emulation of interface interactions, accounting for coordinates and element states
- Handling errors, timeouts, and unstable interface states