Skip to content
Advertisement

Why does my Selenium URL_to_be statement not work?

Selenium does not seem to register that I manually go to the publish0x.com page. Does anyone know a solution?

My goal is to manually do the captcha at the login page and afterwards, when I log in and land on the main page I want the script to resume.

JavaScript

Advertisement

Answer

There are two ways I can think of, one by adding an Input statement like this:

JavaScript

In this way, the user would complete the data and then press any key for the script to continue.

The other way is by adding a try and except statement.

JavaScript

In this, replace the element id “some-element” with any element that is present and only present after the user logs in, for e.g elements like Profile_nav or Settings are only present when someone logs in. So if the element doesn’t exist then it would mean that the user didn’t complete the captcha.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement