import { Page , ElementHandle , Frame } from 'playwright' ; export async function querySelectorAllInPage ( selector , page ) { if ( ! page ) { throw new Error ( `Cannot query selector '${ selector }' because no browser has been launched` ) ; } const elements = await page . $$ ( selector ) ; return elements ; }