latest error resolved
This commit is contained in:
@@ -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 (_) {
|
||||
|
||||
Reference in New Issue
Block a user