Login located in iFrame not reloading page using selenium

和自甴很熟 提交于 2019-12-11 07:51:55

问题


I'm trying to create a script to log into my account. I have gotten to the point where I can enter the username and such in, but whether I submit, send enter, or click the login button, the iFrame box goes blank, yet the page doesn't reload to the logged in page.

I've noticed that regardless of the number of sleeps I put in, the result doesn't change. However, if I manually press enter or click the submit button, the page will reload properly.

Any solutions?

Edit: http://mpe.berklee.edu/studio/booking/practice.php

driver.switch_to.frame(frame_reference = driver.find_element_by_xpath('//*[@id="loginframe"]'))
login = driver.find_element_by_xpath('//*[@id="user"]')
password = driver.find_element_by_xpath('//*[@id="password"]')
loginButton = driver.find_element_by_xpath('//*[@name="submitit"]')

login.send_keys('XXXXXX')
password.send_keys('XXXXXX')
time.sleep(1)
password.submit()
driver.switch_to_default_content()

来源:https://stackoverflow.com/questions/53625732/login-located-in-iframe-not-reloading-page-using-selenium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!