How to use page.goto

A page object spawned in by using the newPage() method can be used to navigate a page. The goto() method enters the given url into the new tab and navigates to it.

Example Script:

let {newPage, end, except, extract, extractAndSave, store, runStore, waitFor} = __sandbox;
let {params, } = OPTIONS;
(async () => { try {
	// -- START --
	const page = await newPage();
	await page.goto('');
	await page.saveSnapshot('example');
	await page.close();
	// -- END --
} catch(e) { except(e) } })(); Goto Script

Downloadable goto Project

Code Breakdown

The given snippet:

  • Opens a new page object using newPage()
  • Navigates to the the url
  • Saves a page snapshot for the user to observe after execution
  • close the page.