I wrote a script that successfully logs into a website. However, after I am logged in the page changes but the URL stays the same. It does not redirect to a different URL that I can now use to find elements and fill forms.
Here is the script:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
driver = webdriver.Firefox()
driver.implicitly_wait(10)
base_url = "https://trakcarelabwebview.nhls.ac.za/trakcarelab/csp/logon.csp"
verificationErrors = []
driver.get(base_url)
##log into website by filling in username and password forms
driver.find_element_by_id("USERNAME").send_keys("XXXX")
driver.find_element_by_id("PASSWORD").send_keys("XXXX")
driver.find_element_by_class_name("clsButton").click()
## at this point the page chages and I am unable to find any of the new elements on the new page
barcode = "11111111"
driver.implicitly_wait(5)
##driver.find_element_by_id("Clear").click()
driver.find_element_by_id("SpecimenParam").send_keys(barcode)
driver.find_element_by_id("Find").click()
driver.quit()
I am not sure at all how I can get selenium to use the newly loaded page after login as the new page on which operations will be performed.