During scraping a javascript base website(link), I've stuck with a click function which is not producing the desired result. I've pasted the code which should return the data under "Fits the following cars" drop down menu but unexpectedly it's just printing the except statement's message. I'm able to scrape all the other data from the same code. Should I add few more lines to get the data hidden under that drop down, if yes then what lines to add.
def product(self,response):
while True:
try:
drop=self.driver.find_element_by_xpath('//*[@id="toggleMakeModelArrow"]')
self.logger.info('Sleep for 3 sec.')
sleep(3)
drop.click()
sel=Selector(text=self.driver.page_source)
drop_down=sel.xpath('//*[@id="CachedItemDispaly_make_model_div"]/select/option/text()').extract()
for i in range(len(drop_down)):
print drop_down[i]+"||"
except NoSuchElementException:
self.logger.info('No more Fits the following cars to load..')
break