Image CAPTCHA Solving
Overview
Image CAPTCHAs display distorted text or numbers that users need to type. These are classic CAPTCHAs commonly found on older websites and forms. Surfsky handles these challenges through our manual solving system.
Quick Start
For most use cases, our simplified CAPTCHA solving approach handles Image CAPTCHAs. See our comprehensive CAPTCHA Solving Guide for full details.
Prerequisites
- Enable
anti_captcha
in your browser profile settings - Use quality proxies for better success rates
Manual Solving
Image CAPTCHA requires providing the URL of the CAPTCHA image:
- Python
- JavaScript
import asyncio
from playwright.async_api import async_playwright
async def solve_image():
async with async_playwright() as p:
# Connect to your Surfsky browser
browser = await p.chromium.connect_over_cdp("ws://your-browser-url")
page = await browser.new_page()
# Create CDP session
client = await page.context.new_cdp_session(page)
# Navigate to page with Image CAPTCHA
await page.goto("https://example.com/protected")
# Find the CAPTCHA image and get its URL
captcha_img = await page.query_selector("img[src*='captcha'], .captcha-image img")
if captcha_img:
# Get the image URL
image_url = await captcha_img.get_attribute("src")
# If it's a relative URL, make it absolute
if image_url and not image_url.startswith("http"):
image_url = f"https://example.com{image_url}"
print(f"Image CAPTCHA detected, solving: {image_url}")
# Solve Image CAPTCHA with required image_url parameter
response = await client.send("Captcha.solve", {
"type": "image",
"image_url": image_url # Required parameter
})
if response.get("status") == "success":
print(f"✓ Image CAPTCHA solved: {response.get('solution')}")
# Type the solution into the input field
input_field = await page.query_selector("input[name='captcha'], #captcha-input")
if input_field and response.get("solution"):
await input_field.fill(response.get("solution"))
# Continue with your automation
await page.wait_for_load_state("networkidle")
else:
print("✗ Failed to solve Image CAPTCHA")
await browser.close()
asyncio.run(solve_image())
const { chromium } = require('playwright');
async function solveImage() {
// Connect to your Surfsky browser
const browser = await chromium.connectOverCDP('ws://your-browser-url');
const page = await browser.newPage();
// Create CDP session
const client = await page.context().newCDPSession(page);
// Navigate to page with Image CAPTCHA
await page.goto('https://example.com/protected');
// Find the CAPTCHA image and get its URL
const captchaImg = await page.$('img[src*="captcha"], .captcha-image img');
if (captchaImg) {
// Get the image URL
let imageUrl = await captchaImg.getAttribute('src');
// If it's a relative URL, make it absolute
if (imageUrl && !imageUrl.startsWith('http')) {
imageUrl = `https://example.com${imageUrl}`;
}
console.log(`Image CAPTCHA detected, solving: ${imageUrl}`);
// Solve Image CAPTCHA with required image_url parameter
const response = await client.send('Captcha.solve', {
type: 'image',
image_url: imageUrl // Required parameter
});
if (response.status === 'success') {
console.log(`✓ Image CAPTCHA solved: ${response.solution}`);
// Type the solution into the input field
const inputField = await page.$('input[name="captcha"], #captcha-input');
if (inputField && response.solution) {
await inputField.fill(response.solution);
}
// Continue with your automation
await page.waitForLoadState('networkidle');
} else {
console.log('✗ Failed to solve Image CAPTCHA');
}
}
await browser.close();
}
solveImage().catch(console.error);
How It Works
Image CAPTCHAs show distorted text that needs to be typed. Our solver:
- Captures the CAPTCHA image
- Uses OCR technology to read the distorted text
- Automatically types the answer in the input field
- Handles various distortion and noise levels
Best Practices
- Clear Images - Higher quality images solve more reliably
- Retry Logic - Some CAPTCHAs may need multiple attempts
- Quality Proxies help avoid rate limiting
- Session Persistence - Reuse profiles when possible
Need Help?
For more details on CAPTCHA solving, see our comprehensive CAPTCHA Solving Guide.
Questions? Contact us at [email protected].