使用Python+;登录Web应用程序后获取空白寻呼机;硒+;网络驱动程序

使用Python+;登录Web应用程序后获取空白寻呼机;硒+;网络驱动程序,python,selenium,selenium-webdriver,Python,Selenium,Selenium Webdriver,我正在尝试使用Python+Selenium+Webdriver登录到Web应用程序 未登录到正确的页面,屏幕显示为空白 登录页面:或 登录主页后: 但登录后,它将不会 有没有办法解决这个问题 from selenium import webdriver profile = webdriver.FirefoxProfile() profile.accept_untrusted_certs = True browser = webdriver.Firefox(firefox_profile=p

我正在尝试使用Python+Selenium+Webdriver登录到Web应用程序

未登录到正确的页面,屏幕显示为空白

登录页面:或 登录主页后:

但登录后,它将不会

有没有办法解决这个问题

from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True

browser = webdriver.Firefox(firefox_profile=profile, executable_path=r'C:\Users\username\Downloads\geckodriver-v0.25.0-win64\geckodriver.exe')

browser.get('https://localhost:58448/fxh/login.jsp')

username = browser.find_element_by_id("j_username")
password = browser.find_element_by_id("j_password")

username.send_keys("fxhadmin")
password.send_keys("fxhadmin")

browser.find_element_by_id("com.ibm.tenx.ui.UIMessages.LOG_IN").click()

如果您可以使用测试url在浏览器中直接打开登录页面:

然后尝试等待页面加载 例如,您可以检查输入的j_用户名是否存在于DOM中

wait = WebDriverWait(browser, 10)

wait.until(EC.presence_of_element_located((By.ID, "j_username")))
并等待,然后单击:

wait.until(EC.element_to_be_clickable((By.ID, "com.ibm.tenx.ui.UIMessages.LOG_IN"))).click()

如果应用程序提供的是空白页面,那么这似乎是应用程序的问题,而不是Selenium的问题。是的,这更像是应用程序上的重定向问题,而不是Selenium问题