1

The following is a seleniumbase python script I'm working on, and need some advice on how to use the get_page_source() method. The second print(html) is not correct because the screen changed, and it is still printing the same initial html. The url remains the same on the browser navigation bar for both cases before and after the button is clicked.

How do I retrieve the final html after the button is clicked?

self.open("https://www.example.com/dashboard")
url = self.get_current_url()
print(url)      # Prints https://www.example.com/dashboard, which is correct
html = self.get_page_source()
print(html)    # Prints the initial html of https://www.example.com/dashboard, which is correct

self.click("//span[contains(.,'Change Screen Button')]")
url = self.get_current_url()
print(url)     # Prints https://www.example.com/dashboard, which is correct since the url remains the same on the browser navigation bar, even though the screen changed
html = self.get_page_source()
print(html)    # Prints the initial html of https://www.example.com/dashboard, which is incorrect

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.