I cannot scrape content because of the cookies. I have been researching and context.addCookies seems to be the way to do it but I still cant get to the content. If I log the html received after I add the cookies, Im only seeing the page with the cookies banner, so cookies were not accepted. What am I doing wrong?
const getHtml = () => {
const browser = await {chromium}["chromium"].launch({headless: false});
const context = await browser.newContext();
const page = await context.newPage()
await page.goto(url);
await page.waitForLoadState("networkidle");
const cookies = await context.cookies()
await context.addCookies(cookies)
const html = await page.content();
await context.close();
await browser.close();
return html;
}