1while driver.find_element_by_tag_name('div'):
2 driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
3 Divs=driver.find_element_by_tag_name('div').text
4 if 'End of Results' in Divs:
5 print 'end'
6 break
7 else:
8 continue