fix: if page closed !get element info

This commit is contained in:
Karishma Shukla
2025-08-21 20:29:36 +05:30
committed by GitHub
parent 93a644b1d8
commit 28a6eb465f

View File

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