mridul.ahuja 4 Coding Enthusiast

I'm using selenium with firefox to load a webpage. The page uses ajax to load new content on clicking the Display More Results button.

However when I try to find this button and simulate a click, it gives the following Stacktrace error. Can anyone tell me what I'm doing wrong ?

Here's my code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait

driver = webdriver.Firefox()
driver.get("http://dir.indiamart.com/search.mp?ss=plastic+machinery")


try:
    elem = elem = WebDriverWait(driver, 20).until(lambda driver : driver.find_element_by_id('scroll2'))
    elem.click()
    print "clicked"
except Exception as e:
    print e


driver.close()

Here's the error I'm getting:

Message: 
Stacktrace:
    at FirefoxDriver.prototype.findElementInternal_ (file:///tmp/tmpAQcOR7/extensions/fxdriver@googlecode.com/components/driver-component.js:10770)
    at FirefoxDriver.prototype.findElement (file:///tmp/tmpAQcOR7/extensions/fxdriver@googlecode.com/components/driver-component.js:10779)
    at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpAQcOR7/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
    at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpAQcOR7/extensions/fxdriver@googlecode.com/components/command-processor.js:12666)
    at DelayedCommand.prototype.execute/< (file:///tmp/tmpAQcOR7/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)