latest error resolved

This commit is contained in:
A R R R Associates
2026-06-30 23:18:42 +05:30
parent f84777ed4f
commit 3bcb6ed093
3 changed files with 23 additions and 7 deletions
+9 -1
View File
@@ -35,8 +35,16 @@ async function switchFinancialYearIfPossible(page, yearCode) {
];
for (const sel of selectors) {
if (page.isClosed()) return false;
const loc = page.locator(sel).first();
if (await loc.count()) {
let found = 0;
try {
found = await loc.count();
} catch (_) {
if (page.isClosed()) return false;
found = 0;
}
if (found) {
try {
await loc.selectOption({ value: yearCode });
} catch (_) {