async function f() {
const browser = await puppeteer.launch({
headless: false,
defaultViewport: { width: 1430, height: 670 },
args: ["--use-fake-ui-for-media-stream"],
});
const page = await browser.newPage();
//not sure if below works actually...
await page.on("console", (msg) => {
for (let i = 0; i < msg.args.length; ++i)
console.log(`${i}: ${msg.args[i]}`);
});
page.setDefaultNavigationTimeout(60000);
await page.goto("http://localhost:4000");
const ContinueToEventS = "body > div:nth-child(11) > div";
await page.waitForSelector(ContinueToEventS);
await page.click(ContinueToEventS);
await browser.close();
}
page.$(selector); //querySelector
page.$$(selector); //querySelectorAll return array
await page.type('#mytextarea', 'World', {delay: 100}); // delay opt
const html = await page.evaluate(body => body.innerHTML, bodyHandle);