python - using Selenium logging in
Question: I followed the accepted answer's solution at: [How to use Selenium with
Python?](http://stackoverflow.com/questions/17540971/how-to-use-selenium-with-
python)

I am trying to log into coinbase <https://coinbase.com/signin>

Here is my code

    
    
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import Select
    from selenium.common.exceptions import NoSuchElementException
    
    
    site = "https://coinbase.com/signin"
    email = "myemail@mymail.com"
    password = "mypassword"
    
    xpaths = {
    'emailTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[2]/div/input',      
    'passwordTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[3]/div/input',
    'submitButton' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[4]/div/input'
        }
    
    browser = webdriver.Firefox()
    browser.get(site)
    
    #Write Username in Username TextBox
    mydriver.find_element_by_xpath(xpaths['emailTxtBox']).send_keys(email)
    
    #Write Password in password TextBox
    mydriver.find_element_by_xpath(xpaths['passwordTxtBox']).send_keys(password)
    
    #Click Login button
    mydriver.find_element_by_xpath(xpaths['submitButton']).click()
    

I run this, and selenium opens coinbase, then refreshes after a couple
seconds, then nothing happens.


Answer: You are specifying:

    
    
    xpaths['usernameTxtBox']
    

but it doesn't exist according to your array:

    
    
    xpaths = {
    'usernameTxtBox' # needs to be in the array
    'emailTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[2]/div/input',      
    'passwordTxtBox' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[3]/div/input',
    'submitButton' : '/html/body/div[2]/div[2]/div[2]/div/div/form/div[4]/div/input'
        }
    

**Edit after comment:** I'd consider either revising your xpath, or Keeping It
Simple, (Stupid).

    
    
    //input[@id='email']
    //input[@id='password']
    //input[@id='signin_button']
    

