Otomasyon botları form gönderimi, hesap oluşturma, veri girişi, izleme gibi tekrarlanabilir görevleri yerine getirir. CAPTCHA'lar bu iş akışlarını kesintiye uğratır. CaptchaAI, CAPTCHA'ları programlı olarak çözer, böylece botlarınız insan müdahalesi olmadan çalışır.
Yaygın Otomasyon Senaryoları
| Senaryo | Tipik CAPTCHA | CaptchaAI Yöntemi |
|---|---|---|
| Form gönderimi | reCAPTCHA v2 | method=userrecaptcha |
| Hesap kaydı | reCAPTCHA v2/v3 | method=userrecaptcha |
| Veri giriş portalları | Resim CAPTCHA'sı | method=base64 |
| Rezervasyon/reservation | Cloudflare Turnstile | method=turnstile |
| API ağ geçidi erişimi | Cloudflare doğrulama akışı | method=cloudflare_challenge |
Genel Bot Çerçevesi
Yeniden kullanılabilir bir CAPTCHA çözme bot çerçevesi oluşturun:
import requests
import time
import logging
logger = logging.getLogger(__name__)
class CaptchaBot:
def __init__(self, api_key):
self.api_key = api_key
self.session = requests.Session()
self.session.headers.update({
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
})
def solve(self, method, **params):
"""Solve any CAPTCHA type."""
params["key"] = self.api_key
params["method"] = method
resp = requests.get("https://ocr.captchaai.com/in.php", params=params)
if not resp.text.startswith("OK|"):
raise Exception(f"Submit error: {resp.text}")
task_id = resp.text.split("|")[1]
logger.info(f"Task submitted: {task_id}")
for _ in range(60):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": self.api_key, "action": "get", "id": task_id
})
if result.text == "CAPCHA_NOT_READY": continue
if result.text.startswith("OK|"): return result.text.split("|")[1]
raise Exception(f"Error: {result.text}")
raise TimeoutError("CAPTCHA solve timed out")
def submit_form(self, url, form_data, captcha_field="g-recaptcha-response",
site_key=None, captcha_method="userrecaptcha"):
"""Submit a form with CAPTCHA solving."""
if site_key:
if captcha_method == "userrecaptcha":
token = self.solve(captcha_method, googlekey=site_key, pageurl=url)
elif captcha_method == "turnstile":
token = self.solve(captcha_method, sitekey=site_key, pageurl=url)
form_data[captcha_field] = token
return self.session.post(url, data=form_data)
Örnek: Form Gönderme Botu
bot = CaptchaBot("YOUR_API_KEY")
# Submit a contact form protected by reCAPTCHA
result = bot.submit_form(
url="https://example.com/contact",
form_data={
"name": "John Doe",
"email": "john@example.com",
"message": "Inquiry about your service"
},
site_key="6Le-wvkS...",
captcha_method="userrecaptcha"
)
print(f"Form submitted: {result.status_code}")
Örnek: Çok Adımlı İş Akışı Botu
def appointment_booking_bot(date, time_slot, user_info):
bot = CaptchaBot("YOUR_API_KEY")
# Step 1: Load booking page
page = bot.session.get("https://example.com/book")
# Step 2: Select date and time
resp = bot.session.post("https://example.com/book/select", data={
"date": date,
"time": time_slot
})
# Step 3: Fill personal info with CAPTCHA
result = bot.submit_form(
url="https://example.com/book/confirm",
form_data={
"name": user_info["name"],
"email": user_info["email"],
"phone": user_info["phone"],
"date": date,
"time": time_slot
},
site_key="6Le-wvkS...",
captcha_method="userrecaptcha"
)
return result.status_code == 200
# Run
success = appointment_booking_bot(
date="2025-02-15",
time_slot="10:00",
user_info={"name": "John Doe", "email": "john@example.com", "phone": "555-0100"}
)
Örnek: Resim CAPTCHA'lı Veri Giriş Botu
import base64
def data_entry_bot(entries, captcha_image_url):
bot = CaptchaBot("YOUR_API_KEY")
for entry in entries:
# Load the form page
page = bot.session.get("https://portal.example.com/entry")
# Download and solve image CAPTCHA
img = bot.session.get(captcha_image_url)
img_b64 = base64.b64encode(img.content).decode()
captcha_text = bot.solve("base64", body=img_b64)
# Submit entry
resp = bot.session.post("https://portal.example.com/entry", data={
**entry,
"captcha": captcha_text
})
logger.info(f"Entry submitted: {resp.status_code}")
time.sleep(random.uniform(2, 5))
Node.js Bot Çerçevesi
const axios = require("axios");
class CaptchaBot {
constructor(apiKey) {
this.apiKey = apiKey;
}
async solve(method, params) {
params.key = this.apiKey;
params.method = method;
const submit = await axios.get("https://ocr.captchaai.com/in.php", {
params,
});
const taskId = submit.data.split("|")[1];
while (true) {
await new Promise((r) => setTimeout(r, 5000));
const result = await axios.get("https://ocr.captchaai.com/res.php", {
params: { key: this.apiKey, action: "get", id: taskId },
});
if (result.data === "CAPCHA_NOT_READY") continue;
if (result.data.startsWith("OK|")) return result.data.split("|")[1];
throw new Error(result.data);
}
}
async submitForm(url, formData, siteKey, method = "userrecaptcha") {
const token = await this.solve(method, {
googlekey: siteKey,
pageurl: url,
});
formData["g-recaptcha-response"] = token;
return axios.post(url, new URLSearchParams(formData));
}
}
// Usage
const bot = new CaptchaBot("YOUR_API_KEY");
const result = await bot.submitForm(
"https://example.com/submit",
{ name: "John", email: "john@example.com" },
"6Le-wvkS..."
);
Sorun giderme
| Sorun | Düzeltme |
|---|---|
| CAPTCHA jetonu reddedildi | Çözdükten sonraki 120 saniye içinde jetonu kullanın |
| Geçerli jetona rağmen bot tespit edildi | Gizli başlıklar ekleyin ve gecikmeleri isteyin |
| Form ek alanlar gerektirir | Form kaynağında gizli alanlar (CSRF belirteçleri) olup olmadığını inceleyin |
| Tekrarlanan gönderimlerde oran sınırlıdır | Gecikmeler ekleyin ve proxy'leri döndürün |
SSS
Otomasyon botları herhangi bir CAPTCHA türünü işleyebilir mi?
CaptchaAI ile evet. API, reCAPTCHA'yı (tüm sürümler), Cloudflare Turnstile, GeeTest, hCaptcha, resim CAPTCHA'larını ve daha fazlasını destekler. Bot çerçevenizin yalnızca türü algılaması ve doğru yöntemi çağırması gerekir.
24/7 botlarını nasıl çalıştırırım?
Zamanlama araçlarını (cron, Görev Zamanlayıcı, systemd) kullanın veya bulut işlevlerine dağıtın. CaptchaAI API, %99,9'dan fazla çalışma süresiyle 24/7 mevcuttur.
CAPTCHA'ların ötesinde anti-botlarla baş etmesi gereken botlara ne dersiniz?
CaptchaAI'yi gizli tarayıcılarla (algılanmayan krom sürücü, Puppeteer ekstra) birleştirin. CaptchaAI, CAPTCHA katmanını yönetir; gizli araçlar test profil yapılandırması algılamayı yönetir.