const browser = await puppeteer.launch({
args: ['--no-sandbox']
});
const page2 = await browser.newPage();
console.log(2)
//set cookies
let time = new Date().getTime()
await page2.setCookie({ name: ".ASPXAUTH", value: request.cookies[".ASPXAUTH"], domain: "activestudent.tupeloschools.com", path: "/", expires: -1, size: request.cookies[".ASPXAUTH"].length + 9, httpOnly: true, secure: false, session: true, sameSite: "Lax" });
await page2.setCookie({ name: "ASP.NET_SessionId", value: request.cookies["ASP.NET_SessionId"], domain: "activestudent.tupeloschools.com", path: "/", expires: -1, size: request.cookies["ASP.NET_SessionId"].length + 17, httpOnly: true, secure: false, session: true, sameSite: "Lax" });
console.log(new Date().getTime() - time)
console.log(2)
await page2.goto('');
console.log(3)
await page2.click("#ctl00_PageData_txtStartDate", {clickCount: 3})
await page2.type('#ctl00_PageData_txtStartDate', date);
await page2.click("#ctl00_PageData_cmdGetNewsDate");
await page2.waitForNavigation();
let html = await page2.content()
So i implemented a couple lines to see how long it takes to set cookies, it takes anywhere from 8-16 seconds JUST to set the cookies. and then the actual actions taken on the site take around 10. that uses up the 30 seconds till it shuts down really really fast.
any way I can speed this up?
(Yes i know i call setcookie twice) i should probably change it