ZFC-Digital / puppeteer-real-browser

This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.
https://www.npmjs.com/package/puppeteer-real-browser
MIT License
797 stars 95 forks source link

Not bypass captcha ClouldFlare #47

Closed alextran317 closed 6 months ago

alextran317 commented 6 months ago

Hello everyone! I've been trying to use Puppeteer with the current browser but can't get bypass the captcha of this particular https://jobnib.com/book/i-am-the-luna-chapter-32 Here is my code.

` (async () => { var { connect } = await import('puppeteer-real-browser') const { page, browser } = await connect({ headless: 'auto', args: [], customConfig: {}, skipTarget: [], fingerprint: false, turnstile: true, connectOption: {}, fpconfig: {}, })

try {
    await page.goto('https://jobnib.com/book/i-am-the-luna-chapter-32');
    await sleep(30000)

} catch (error) {
    console.error('Lỗi:', error);
} finally {
    await browser.close();
    pool.end();
    process.exit(1); 
}

})(); `

Thank all

mdervisaygan commented 6 months ago

Hi, I was able to pass it without any problem. Can you please test it with the code below?

https://github.com/zfcsoftware/puppeteer-real-browser/assets/123484092/81a18b84-4967-454b-b757-7f50a9999377


(async () => {
    var { connect } = await import('puppeteer-real-browser')
    const { page, browser } = await connect({
    headless: 'auto',
    args: [],
    customConfig: {},
    skipTarget: [],
    fingerprint: false,
    turnstile: true,
    connectOption: {},
    fpconfig: {},
    })

    try {
        setInterval(() => {
            page.screenshot({ path: 'screenshot.png' });
        }, 1000);
        await page.goto('https://jobnib.com/book/i-am-the-luna-chapter-32');
        await page.waitForTimeout(30000);

    } catch (error) {
        console.error('Lỗi:', error);
    } finally {
        // await browser.close();
        // pool.end();
        // process.exit(1); 
    }
    })();
alextran317 commented 6 months ago

Wow, I have also succeeded, but it has caused another problem, which is when I make multiple requests (even though I have slept for about 20s with each request), the website will block the device or IP address, then I cannot crawl anymore. So, could you please tell me how to handle the issue above?

Thank you very much

Capture

mdervisaygan commented 6 months ago

This seems to be due to the site crashing or banning the ip address. I suggest you increase your request range and start with a vpn or proxy. The issue in the discussion has been resolved so I'm closing it. Feel free to start a new one if you have any problems. Thank you.