0

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)

Edited by mridul.ahuja

1
Contributor
0
Replies
6
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.