so i go a result when i send the request and then i tried to inject it and post and some other metohds but no one worked right
is there any spisefic method or something i miss maybe ?
i was try to bypass the captcha i got the result but i didnt know how to inject it or post it to the frame of the captcha it’s just not response anything…
async function solveFuncaptcha(driver) {
try {
console.log("Waiting for first CAPTCHA frame to load...");
const firstFrame = await driver.wait(
until.elementLocated(By.css('iframe[id="enforcementFrame"]')),
30000
);
console.log(
"First CAPTCHA frame detected. Switching to enforcement frame..."
);
await driver.switchTo().frame(firstFrame);
console.log("Waiting for second CAPTCHA frame to load...");
const secondFrame = await driver.wait(
until.elementLocated(By.css('iframe[data-e2e="enforcement-frame"]')),
30000
);
console.log("Second CAPTCHA frame detected. Switching to it...");
await driver.switchTo().frame(secondFrame);
console.log("Waiting for game core frame to load...");
const gameCoreFrame = await driver.wait(
until.elementLocated(By.css('iframe[id="game-core-frame"]')),
30000
);
console.log("Game core frame detected. Extracting public key...");
const gameCoreFrameSrc = await gameCoreFrame.getAttribute("src");
const publicKeyMatch = gameCoreFrameSrc.match(/pk=([^&]+)/);
if (!publicKeyMatch) {
throw new Error("Unable to find public key in game-core-frame src");
}
const publicKey = publicKeyMatch[1];
console.log("Extracted public key:", publicKey);
console.log("Switching back to default content...");
await driver.switchTo().defaultContent();
console.log("Attempting to solve CAPTCHA with 2captcha...");
const result = await solver.funCaptcha({
publickey: publicKey,
pageurl: await driver.getCurrentUrl(),
surl: "https://client-api.arkoselabs.com",
});
if (!result || !result.data) {
throw new Error("CAPTCHA solving failed: No result from 2captcha");
}
console.log("CAPTCHA solved. Result:", result);
console.log("Navigating back through the frames to submit the solution...");
await driver.switchTo().frame(firstFrame);
await driver.switchTo().frame(secondFrame);
console.log("Submitting CAPTCHA solution...");
await driver.executeScript(`
parent.postMessage(JSON.stringify({
eventId: "challenge-complete",
payload: {
sessionToken: "${result.data}"
}
}), "*");
`);
} catch (error) {
console.error("Error solving CAPTCHA:", error.message);
return false;
}
}
New contributor
jeogo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.