Attribute error in python while trying to sign in
Question: I am using python (with selenium webdriver) to sign into yahoo.

Below is the code:

    
    
    import unittest
    from   selenium import webdriver
    from   selenium.common.exceptions import NoSuchElementException
    
    #Set Selenium firefox browser object
    browser = webdriver.Firefox()
    
    #Navigate to desired page
    browser.get( 'https://www.yahoo.com/' )
    
    try:
        element = browser.find_element_by_title( 'Sign In' )
    except NoSuchElementException:
        self.fail( "found: %s" % 'Sign In' )
    

Below is the error I see:

    
    
    element = browser.find_element_by_title( 'Sign In' ) 
    AttributeError: 'WebDriver' object has no attribute 'find_element_by_title'
    

Any suggestions how to fix this error?


Answer: Use [`find_element_by_link_text()`](http://selenium-
python.readthedocs.org/en/latest/api.html#selenium.webdriver.remote.webelement.WebElement.find_element_by_link_text)
instead:

    
    
    element = browser.find_element_by_link_text('Sign In')
    

Demo:

    
    
    >>> from selenium import webdriver
    >>> browser = webdriver.Firefox()
    >>> browser.get('https://www.yahoo.com/')
    >>> element = browser.find_element_by_link_text('Sign In')
    >>> element
    <selenium.webdriver.remote.webelement.WebElement object at 0x1087fc5d0>
    

