sisa-crawl/gotodashboard.js

31 lines
933 B
JavaScript
Raw Permalink Normal View History

const {runId, dasbhoardInschrijvingenURL} = require('./vars.js');
async function runGoToDashboard(page) {
try {
await page.waitForSelector('#PS_SCP_REG_USER_F_S\\$19'); // Escape `$` in the ID
// Click the element
await page.click('#PS_SCP_REG_USER_F_S\\$19');
try {
await page.goto(dasbhoardInschrijvingenURL);
} catch (error) {
console.error("The page could not be reached.", error);
}
await page.waitForSelector('#PRCSRUNCNTL_RUN_CNTL_ID')
await page.type("#PRCSRUNCNTL_RUN_CNTL_ID[type='text']", runId)
await page.keyboard.press("Enter");
await page.waitForSelector('#PTS_CFG_CL_RSLT_NUI_SRCH1\\$12\\$\\$0')
await page.click('#PTS_CFG_CL_RSLT_NUI_SRCH1\\$12\\$\\$0')
return page;
} catch (error) {
console.error("An error occurred:", error);
}
}
module.exports = runGoToDashboard;