This commit is contained in:
Harsh Gupta 2024-09-18 09:48:30 +05:30
parent cc4d316764
commit 66e5d42d2e

View File

@ -15,7 +15,7 @@ import tldExtract from 'tld-extract';
// Add this new function for cookie validation
const validateCookie = (cookie: CookieParam) => {
const requiredFields = ['name', 'value', 'domain'];
const requiredFields = ['name', 'value'];
for (const field of requiredFields) {
if (!cookie[field]) {
throw new Error(`Cookie is missing required field: ${field}`);
@ -614,26 +614,6 @@ document.addEventListener('load', handlePageLoad);
}
});
try {
console.log('Waiting for Sign Out link');
await page.waitForSelector('a[href="/signout"]', { timeout: 10000 });
console.log('Sign Out link found');
} catch (error) {
this.logger.warn(`Timed out waiting for Sign Out link: ${error}`);
}
try {
console.log('Clicking on #getOwnerDetails');
await page.click('#getOwnerDetails');
console.log('Clicked on #getOwnerDetails');
// console.log('Waiting for Phone No span to appear');
// await page.waitForSelector('span:contains("Phone No :")', { timeout: 10000 });
// console.log('Phone No span appeared');
} catch (error) {
this.logger.warn(`Error during click or wait operation: ${error}`);
}
let waitForPromise: Promise<any> | undefined;
if (options?.waitForSelector) {
console.log('Waiting for selector', options.waitForSelector);