0
  • .NET Framework 4.7
  • Selenium 3.141
  • Chromium 79 (embedded in the project)

So I've inherited this WPF app that uses selenium to automate various actions on a governmental website (https://skat.dk/). Reading data from pages behind login, downloading documents, and so on.

They do those actions for hundreds of customers which they are able to do, albeit a really slow process that we've automated. However when we parse the site with selenium, at some random point somewhere between the 200th and 400th customer the site we're parsing data from will sign out.

When navigating and parsing from the site it's all done with selenium Actions. And we have tried with FindElement(By).Click as well.

The parts of the site we're parsing is all serverside rendered and it takes between 1 and 2 hours before we get signed out. So I guess we're not organic enough in our navigation even though it seems kinda random?

I'm kinda stumped as to what I could even do to solve this. I could open 2 windows, but that would require them to log in twice (and require too much refactoring). The site normally has a pretty high timeout before signing out, and the slowest thing we do is (ctrl + p) print a pdf, which takes about 10 seconds.

Ja Da
  • 230
  • 2
  • 12
  • you said its a governmental site, maybe the session is just 2 hours? While parsing you probably use driver.get in a seperate method. Try to add login checks, and then login if that fails. – Rolandas Ulevicius Feb 24 '23 at 09:00
  • It could be. Or just one hour. We might end up logging in again, though that's kinda one thing we would like to end up avoiding – Ja Da Feb 24 '23 at 09:48
  • Did you try using [cookies or user profile](https://stackoverflow.com/a/75589648/8157304) to avoid the login process? If the site is detecting bot automation, you could try using a library which emulates human interactions https://github.com/droefs/HLISA – sound wave Feb 28 '23 at 18:49

0 Answers0