To perform automation on the next page do I have to write some different code in a different function as the URL changes after logging in also the button which I'm trying to click on the next page doesn't have any ID or CLASS. Here is the button which im trying to select:
<div class="BenchTool NewEnquiry Orange" data-bind="click: Logic.Enquiry.NewEnquiry">
<div> </div>
<span>New Enquiry</span>
</div>
Here is the code which I have written in puppeteer
const puppeteer = require("puppeteer");
async function main () {
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
await page.goto("https://onecall.linesearchbeforeudig.co.uk/uk-b4-en/Account/Login?returnUrl=%2Fuk-b4-en%2FWorkBench");
await page.$eval('input[name=emailOrUserName]', el => el.value = 'Pramod Rai');
await page.$eval('input[name=password]', el => el.value = '******');
await page.click('#acceptTermsAndConditions');
await page.click('#login-submit');
};
main();
Im able to login using this code but not able to click the button on the next page, I tried pressing Enter that doesn't work, also tried clicking it based on Co-ordinates but that doesn't seem to work as well; any help will be appreciated. Thanks!