selenium python click on element nothing happens
Question: I am trying to click on the Gmail link on the Google frontpage in Selenium
with the WebDriver on Python. My code basically replicates the one found here:
[Why Cant I Click an Element in
Selenium?](http://stackoverflow.com/questions/16511059/why-cant-i-click-an-
element-in-selenium)

My Code:

    
    
    import selenium.webdriver as webdriver
    firefox = webdriver.Firefox()
    firefox.get("http://www.google.ca")
    element = firefox.find_element_by_xpath(".//a[@id='gb_23']")
    element.click()
    

The webdriver loads the page and then nothing happens. I've tried using the
ActionChains and move_to_element(element), click(element), then perform() but
nothing happens either.


Answer: Use `find_element_by_id` method:

    
    
    element = firefox.find_element_by_id("gb_23")
    element.click()
    

or correct your xpath to:

    
    
    "//a[@id='gb_23']"
    

[Here you have nice
tutorial.](http://zvon.org/xxl/XPathTutorial/General/examples.html)

