I am trying to scroll down an HTML table until the last row is visible, the table initially loads about 20 rows and then loads more as I scroll down. I am using selenium webdriver and python to automate this process but so far i am stuck as my code below is scrolling down the whole page instead of this particular table which is passed as an argument in the function.
here is my code the web element to be scrolled is passed as an argument as well as the number of times it will be scrolled down
def scroll_down_element(self, element, times):
try:
action_chain = ActionChains(self.browser)
counter = 0
while(counter < times):
element.send_keys(Keys.ARROW_DOWN)
counter += 1
sleep(0.25)
except Exception as e:
print 'error scrolling down web element', e
All suggestions are welcome