I'm trying to navigate to the next page after my successful login with the script below.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
url = 'https://login.morganstanleyclientserv.com/'
chromedriver = 'path to chromedriver.exe'
driver = webdriver.Chrome(chromedriver)
driver.get(url)
username = driver.find_element_by_name('userid')
username.send_keys('xxxxx')
password = driver.find_element_by_name('password')
password.send_keys('xxxxx')
password.send_keys(Keys.RETURN)
After it hits 'enter' the browser shows the spinning wheel on the login page but never goes away and nothing happens. I've tried using various WebDriverWait's ie:
WebDriverWait(driver,10).until(EC.presence_of_element_located((By.ID,"firstSecCode"))) but still have not made any progress.
This scrape has been causing me headaches when using casperjs as well: Script is timing out and not finding selector
EDIT:
I've found a temporary workaround for this, but I'm still not satisfied as it involves a manual step still. What I have to do is clear my cache & cookies, then go to the page and login and wait for the page to load. After this, the script runs no problem with my imported chrome profile that contains the cookie(s) collected from the manual login.