So the site that I am trying to use selenium has two pages but under the same URL; once you finish filling up the first register form, it will redirect you to the hCaptcha but it has the same URL, and when I try to find the element and switch the iFrame, it keeps saying it cannot find the element.
Site: https://discord.com/register
Code that I have tried.
.then(async function () {
await tab.sleep(5000);
console.log("Sleep Finished");
let findCaptcha = await tab.findElement(swd.By.css('div.Class for Div > div > iframe[src*="SRC of the Iframe"]'));
await tab.switchTo().frame(findCaptcha);
let buttonCatpcha = tab.findElement(swd.By.id("checkbox"));
return buttonCatpcha;
})
Here is the HTML code in the inspect element site: https://pastebin.com/qMWuAfKW