As plataformas de leilão protegem os dados de listagem e a funcionalidade de pesquisa com reCAPTCHA v2. CAPTCHAs aparecem com mais frequência durante consultas de pesquisa rápidas, visualizações de detalhes de listagens e pesquisas de histórico de lances. Veja como manter um monitoramento confiável em sites de leilões.
Onde os CAPTCHAs são acionados em sites de leilão
| Ação | Tipo CAPTCHA | Padrão de gatilho |
|---|---|---|
| Listagens de pesquisa/browse | reCAPTCHA v2 | Pesquisas sequenciais rápidas |
| Ver detalhes da listagem | reCAPTCHA v2 | Alto volume do mesmo IP |
| Verifique o histórico de lances | reCAPTCHA v2 | Carregamentos repetidos de páginas de detalhes |
| Navegação por categoria | Cloudflare Turnstile | Velocidade de navegação semelhante à de um bot |
| Páginas de alerta de preço | reCAPTCHA v2 | Atualizações frequentes |
Monitoramento de Leilões com Resolução CAPTCHA
import requests
import time
import re
from datetime import datetime
class AuctionMonitor:
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 search_listings(self, auction_url, query, category=None):
"""Search auction listings, solving CAPTCHAs when triggered."""
params = {"q": query}
if category:
params["category"] = category
response = self.session.get(
f"{auction_url}/search", params=params
)
if self._has_captcha(response.text):
site_key = self._extract_site_key(response.text)
token = self._solve_recaptcha(site_key, f"{auction_url}/search")
response = self.session.post(
f"{auction_url}/search",
data={**params, "g-recaptcha-response": token}
)
return self._parse_listings(response.text)
def monitor_listing(self, auction_url, listing_id):
"""Get current bid and listing details."""
url = f"{auction_url}/item/{listing_id}"
response = self.session.get(url)
if self._has_captcha(response.text):
site_key = self._extract_site_key(response.text)
token = self._solve_recaptcha(site_key, url)
response = self.session.post(url, data={
"g-recaptcha-response": token
})
return self._parse_listing_detail(response.text)
def track_bids(self, auction_url, listing_ids, interval=60):
"""Track bid changes across multiple listings."""
history = {lid: [] for lid in listing_ids}
while True:
for listing_id in listing_ids:
try:
detail = self.monitor_listing(auction_url, listing_id)
previous = history[listing_id]
if previous and detail["current_bid"] != previous[-1]["current_bid"]:
print(f"Bid change on {listing_id}: "
f"${previous[-1]['current_bid']} → ${detail['current_bid']}")
history[listing_id].append(detail)
except Exception as e:
print(f"Error checking {listing_id}: {e}")
time.sleep(interval)
def _has_captcha(self, html):
return "g-recaptcha" in html or "recaptcha" in html.lower()
def _extract_site_key(self, html):
match = re.search(r'data-sitekey="([^"]+)"', html)
if match:
return match.group(1)
match = re.search(r"sitekey['\"]?\s*[:=]\s*['\"]([^'\"]+)", html)
if match:
return match.group(1)
raise ValueError("Could not find reCAPTCHA site key")
def _solve_recaptcha(self, site_key, page_url):
resp = requests.post("https://ocr.captchaai.com/in.php", data={
"key": self.api_key,
"method": "userrecaptcha",
"googlekey": site_key,
"pageurl": page_url,
"json": 1
})
task_id = resp.json()["request"]
for _ in range(60):
time.sleep(3)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": self.api_key,
"action": "get",
"id": task_id,
"json": 1
})
data = result.json()
if data["status"] == 1:
return data["request"]
raise TimeoutError("reCAPTCHA solve timed out")
def _parse_listings(self, html):
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, "html.parser")
def text_or_none(node):
return node.text.strip() if node and node.text else None
def attr_or_none(node, attr):
return node.get(attr) if node else None
listings = []
for item in soup.select(".listing-item, .auction-item"):
listings.append({
"title": text_or_none(item.select_one(".title")),
"current_bid": text_or_none(item.select_one(".price, .bid")),
"time_left": text_or_none(item.select_one(".time-left")),
"url": attr_or_none(item.select_one("a"), "href")
})
return listings
def _parse_listing_detail(self, html):
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, "html.parser")
def text_or_none(node):
return node.text.strip() if node and node.text else None
return {
"title": text_or_none(soup.select_one("h1, .item-title")),
"current_bid": text_or_none(soup.select_one(".current-bid, .price")),
"bid_count": text_or_none(soup.select_one(".bid-count")),
"time_left": text_or_none(soup.select_one(".time-remaining")),
"checked_at": datetime.now().isoformat()
}
# Usage
monitor = AuctionMonitor("YOUR_API_KEY")
listings = monitor.search_listings(
"https://auctions.example.com",
"vintage electronics",
category="collectibles"
)
Sistema de Alerta de Preço (JavaScript)
class AuctionTracker {
constructor(apiKey) {
this.apiKey = apiKey;
this.watchList = new Map();
}
addWatch(listingId, url, maxPrice) {
this.watchList.set(listingId, { url, maxPrice, history: [] });
}
async checkAll() {
const alerts = [];
for (const [id, watch] of this.watchList) {
try {
const detail = await this.fetchListing(watch.url);
watch.history.push(detail);
const price = parseFloat(detail.currentBid.replace(/[^0-9.]/g, ''));
if (price >= watch.maxPrice * 0.9) {
alerts.push({
listing: id,
price,
threshold: watch.maxPrice,
message: `Price approaching limit: $${price} / $${watch.maxPrice}`
});
}
} catch (error) {
alerts.push({ listing: id, error: error.message });
}
}
return alerts;
}
async fetchListing(url) {
const response = await fetch(url);
const html = await response.text();
if (html.includes('g-recaptcha')) {
return this.solveAndFetch(url, html);
}
return this.parseDetail(html);
}
async solveAndFetch(url, html) {
const siteKeyMatch = html.match(/data-sitekey="([^"]+)"/);
if (!siteKeyMatch) throw new Error('No reCAPTCHA site key found');
const submitResp = await fetch('https://ocr.captchaai.com/in.php', {
method: 'POST',
body: new URLSearchParams({
key: this.apiKey,
method: 'userrecaptcha',
googlekey: siteKeyMatch[1],
pageurl: url,
json: '1'
})
});
const { request: taskId } = await submitResp.json();
for (let i = 0; i < 60; i++) {
await new Promise(r => setTimeout(r, 3000));
const result = await fetch(
`https://ocr.captchaai.com/res.php?key=${this.apiKey}&action=get&id=${taskId}&json=1`
);
const data = await result.json();
if (data.status === 1) {
// Resubmit with token
const response = await fetch(url, {
method: 'POST',
body: new URLSearchParams({ 'g-recaptcha-response': data.request })
});
return this.parseDetail(await response.text());
}
}
throw new Error('reCAPTCHA solve timed out');
}
parseDetail(html) {
// Parse auction listing details from HTML
return {
currentBid: html.match(/current.?bid[^>]*>([^<]+)/i)?.[1]?.trim(),
bidCount: html.match(/(\d+)\s*bids?/i)?.[1],
timeLeft: html.match(/time.?(?:left|remaining)[^>]*>([^<]+)/i)?.[1]?.trim(),
checkedAt: new Date().toISOString()
};
}
}
// Usage
const tracker = new AuctionTracker('YOUR_API_KEY');
tracker.addWatch('item-123', 'https://auctions.example.com/item/123', 500);
tracker.addWatch('item-456', 'https://auctions.example.com/item/456', 200);
const alerts = await tracker.checkAll();
Estratégia de Monitoramento
| Verifique a frequência | Caso de uso | Taxa CAPTCHA esperada |
|---|---|---|
| A cada 30 segundos | Lance de última hora | Alto – use proxies |
| A cada 5 minutos | Acompanhamento de leilão ativo | Moderado |
| A cada 15 minutos | Monitoramento de lista de observação | Baixo |
| A cada hora | Pesquisa de preços de longo prazo | Mínimo |
Reduzindo a frequência CAPTCHA
| Técnica | Impacto |
|---|---|
| Reutilizar cookies de sessão | Mantém o estado autenticado |
| Alternar proxies residenciais | Distribui solicitações entre IPs |
| Randomizar intervalos de solicitação | Evita padrões de detecção periódicos |
| Use contas autenticadas | Limites mais baixos de acionamento de CAPTCHA |
Solução de problemas
| Problema | Causa | Correção |
|---|---|---|
| CAPTCHA em cada solicitação | Sem persistência de sessão | Reutilizar requests.Session() |
| Token reCAPTCHA rejeitado | O token expirou (vida útil de 2 minutos) | Resolva logo antes do envio |
| A página de listagens mostra 0 resultados | Resultados CAPTCHA filtrados silenciosamente | Verifique se há elementos CAPTCHA ocultos |
| IP bloqueado após muitos CAPTCHAs | Limite de taxa excedido | Gire proxies, aumente intervalos |
Perguntas frequentes
Com que rapidez posso verificar as listagens do leilão?
CaptchaAI resolve reCAPTCHA v2 em 10 a 30 segundos. Para leilões urgentes, pré-resolva tokens e gire proxies para minimizar atrasos.
Os sites de leilão detectarão o monitoramento?
A detecção depende de padrões de solicitação, não de resolução de CAPTCHA. Use intervalos realistas, alterne os agentes do usuário e evite problemas durante horários de baixo tráfego, quando suas solicitações se destacam.
Posso monitorar leilões ao vivo em tempo real?
Nos minutos finais de um leilão, use a automação do navegador com sessões pré-autenticadas para minimizar encontros com CAPTCHA. A velocidade do CaptchaAI lida com qualquer CAPTCHA que ainda apareça.
Artigos relacionados
- Como resolver o retorno de chamada do Recaptcha V2 usando API
- Torniquete Recaptcha V2 no mesmo local
- Mecanismo de retorno de chamada Recaptcha V2
Próximas etapas
Monitore leilões de maneira confiável -obtenha sua chave API CaptchaAIe resolva os desafios reCAPTCHA v2 automaticamente.