I have a Python 3.5 script that basically logs into a web site (and gets redirected after login) and then navigates to another page where it actually does its job. If I run webdriver.get()
to this second page right after the login, it doesn't navigate to the target location and stays on the page it gets redirected to after I log in. But if I put a breakpoint or just time.sleep(5)
- it opens up fine. I found this question with the C# code, where it is suggested to add async waits. Is there a Pythonic way to work around it?
My code for reference:
# underneath is webdriver.Chrome() wrapped up in some exception handling
mydriver = get_web_driver()
# do the first get, wait for the form to load, then fill in the form and call form.submit()
login(mydriver, login_page, "username", "password")
# perform the second get() with the same webdriver
open_invite_page(mydriver, group_invite_page)