I am using Selenium to log into a HikVision IP camera web client and I am experiencing an issue. The automated browser seems to successfully log in, as it loads the next page, but when I return page_source(), it shows that the webdriver is still stuck on the log in page. I have tried implementing wait/until and implicit waits for the web page to load but it does not seem to be a loading issue, as no matter how long I wait, I get the same problem.
Here is a code snippet showing how I log in:
user = driver.find_element_by_id("username")
password = driver.find_element_by_id("password")
# log in
user.clear()
user.send_keys("admin")
password.clear()
password.send_keys("Snipr123")
driver.find_element_by_css_selector(".btn.btn-primary.login-btn").click()
The .clear() was just to get rid of the preloaded text that was giving me issues.
After the login click() the automated browser successfully loads the web client, but the webdriver doesn't, since page_source() still returns the log in page.
Any ideas on what could be going wrong would be greatly appreciated.