zfcsoftware / 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
622 stars 84 forks source link

Need an update of puppeteer-core to version ^23 #134

Closed pwnz22 closed 3 weeks ago

pwnz22 commented 1 month ago

Hey!

I'm having an error when setting cookie with page.setCookie(cookie). There is a partitionKey in cookie object and in the previous version of puppeteer there was an error but they updated and fixed it. Can you please update also puppeteer to version 23 please to fix this, thanks

issue link

zfcsoftware commented 4 weeks ago

For now you can use it as follows. The library is currently using @rebrowser. So I am waiting for the update for now. https://github.com/rebrowser/rebrowser-patches

    let cookies = []
                if (cookies && cookies.length > 0) {
                    console.log('Set Cookies');
                    const client = await page.target().createCDPSession();
                    for (let cookie of cookies) {
                        try { await client.send('Network.setCookie', cookie); } catch (e) {
                            try {
                                cookie.partitionKey = undefined
                                await client.send('Network.setCookie', cookie);
                            } catch (e) {
                                console.log(e.message);
                            }
                        }
                    }
                }
zfcsoftware commented 3 weeks ago

Can you try again with the latest version?

pwnz22 commented 3 weeks ago

Updated to version 1.3.9. Working like a charm. 🚀