Nguyen
Nguyen6mo ago

hoangvu12 – 15-41 Feb 1

I want to make a script using puppeteer, go to a CF website, solve the captcha manually then get the cookies. The problem is I can't seem to solve the captcha, whenever I click on "Verify", it show the loading spinner for 1-2 seconds then refresh the page. Here is the code:
import puppeteer from "puppeteer-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";

puppeteer.use(StealthPlugin());

puppeteer
.launch({
headless: false,
})
.then(async (browser) => {
console.log("Running tests..");
const page = await browser.newPage();
await page.goto(
"https://example.com"
);

console.log("Waiting for the page to load..");

await page.waitForRequest((request) => {
return (
request.url() ===
"https://example.com" &&
request.method() === "POST"
);
});

const cookies = await page.cookies();

console.log(cookies);

console.log(`All done, check the screenshot`);
});
import puppeteer from "puppeteer-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";

puppeteer.use(StealthPlugin());

puppeteer
.launch({
headless: false,
})
.then(async (browser) => {
console.log("Running tests..");
const page = await browser.newPage();
await page.goto(
"https://example.com"
);

console.log("Waiting for the page to load..");

await page.waitForRequest((request) => {
return (
request.url() ===
"https://example.com" &&
request.method() === "POST"
);
});

const cookies = await page.cookies();

console.log(cookies);

console.log(`All done, check the screenshot`);
});
1 Reply
reactibot
reactibot6mo ago
This thread hasn’t had any activity in 36 hours, so it’s now locked. Threads are closed automatically after 36 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1202639946381271160 Question not getting answered? Maybe it's hard to answer, or maybe you asked at a slow time. Check out these resources for help asking a good question: https://stackoverflow.com/help/how-to-ask http://wp.me/p2oIwo-26