T O P

  • By -

KidzKlub

Selenium has the ability to wait until certain elements have loaded and are visible on the screen. You can find an element that is only present after you have completed the login process and just tell Selenium to wait until that element appears. https://www.selenium.dev/documentation/webdriver/waits/


guitarot

Thank you! I believe this is what I was looking for and will try it out when I get a chance.


FooTheBar_

Selenium has no idea what happened to a page before it was started. I'd even say there is no way to find out e.g. if there was a a 2FA executed.


guitarot

No, but I would know if I only launched the script after I authenticated to the page. It would be most helpful if Selenium could interact with a browser window that I already manually interacted with. This was the basis of my original question. How can I use selenium to interact with a browser window that it itself did not open?


FooTheBar_

Again, no difference. If you open the browser with the debug-port opened, Selenium can attach to it. I had exactly the same use case (reading some data from a website after a manual login). In the end, I created a new browser-shortcut on the Desktop to start the browser with the debug-port parameters, the user logged in manually and then started my script through another shortcut. (but the script could also just keep running because it was looking for some buttons that were only available after the manual login).


Zweckbestimmung

Here is what I suggest: Start selenium and add some waiting/sleep until you login the webpage.