Your sample code looks like a puppeteer script.
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
and the same thing in Taiko await openBrowser()
await goto('https://example.com');
await screenshot({path: 'example.png'});
await closeBrowser();If it is then its no better than using a page handle (as a handle would be required)