fix: if page closed !get element info

This commit is contained in:
Karishma Shukla
2025-08-21 20:30:49 +05:30
committed by GitHub
parent 28a6eb465f
commit 1abfd6a811

View File

@@ -306,6 +306,10 @@ export const getElementInformation = async (
);
return elementInfo;
} else {
if (page.isClosed()) {
logger.debug('Page is closed, cannot get element information (else branch)');
return null;
}
const elementInfo = await page.evaluate(
async ({ x, y }) => {
const getDeepestElementFromPoint = (x: number, y: number): HTMLElement | null => {