Closed mrickymuliawan closed 3 months ago
did you try page.setCookie?
const browser = await puppeteer.launch(); const page = await browser.newPage(); await useProxy(page, 'http://127.0.0.1:80'); await page.goto('https://example.com');
const cookies = [ { name: 'cookie1', value: 'val1', domain: 'example.com' }, { name: 'cookie2', value: 'val2', domain: 'example.com' }, { name: 'cookie3', value: 'val3', domain: 'example.com' } ];
await page.setCookie(...cookies);
// Verify cookies are set const cookiesSet = await page.cookies('https://example.com'); console.log(JSON.stringify(cookiesSet));
Hi my project is using puppeteer-cluster and i want. to use setCookie with the proxy, if i use the proxy, the cookies did not want to set. please help this issue. thank you