Merge pull request #445 from getmaxun/select-fix
fix: add error handling for selector generation
This commit is contained in:
@@ -1092,12 +1092,16 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
|
|||||||
newPath.splice(i, 1);
|
newPath.splice(i, 1);
|
||||||
const newPathKey = selector(newPath);
|
const newPathKey = selector(newPath);
|
||||||
if (scope.visited.has(newPathKey)) {
|
if (scope.visited.has(newPathKey)) {
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
if (unique(newPath) && same(newPath, input)) {
|
try {
|
||||||
yield newPath;
|
if (unique(newPath) && same(newPath, input)) {
|
||||||
scope.visited.set(newPathKey, true);
|
yield newPath;
|
||||||
yield* optimize(newPath, input, scope);
|
scope.visited.set(newPathKey, true);
|
||||||
|
yield* optimize(newPath, input, scope);
|
||||||
|
}
|
||||||
|
} catch (e: any) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user