fix: if page closed !get element selector

This commit is contained in:
Karishma Shukla
2025-08-21 20:33:14 +05:30
committed by GitHub
parent 1abd277fc4
commit d1c5a60417

View File

@@ -1092,6 +1092,10 @@ export const getRect = async (page: Page, coordinates: Coordinates, listSelector
*/
export const getSelectors = async (page: Page, coordinates: Coordinates) => {
try {
if (page.isClosed()) {
logger.debug('Page is closed, cannot get selectors');
return null;
}
const selectors: any = await page.evaluate(async ({ x, y }) => {
// version @medv/finder
// https://github.com/antonmedv/finder/blob/master/finder.ts