I am trying to get all rows from dynamic table which is not fully loaded. It has nearly 2k rows so that I need to scroll down to load table then I need to get all elements from xpath. Here is my code block:
try:
elem = driver.find_element_by_xpath("//table[@class = 'ng-scope ng-table']")
for _ in range(50):
driver.execute_script("arguments[0].scrollIntoView();", elem)
driver.implicitly_wait(0.2)
except Exception as e:
print ("Error scrolling down web element = " + str(e))
driver.quit()
# To get all elements in table (It only takes first 25 since others could not be loded without scrolling)
elements = wait.until(EC.visibility_of_all_elements_located((By.XPATH, "//div[@class = 'scrolly-table']//tr[@class = 'base ng-scope']")))
But its action is putting the table top of screen. Even i try to manually scroll it while putting some sleep points, it again sctoll to top of table. Neither gives error nor scrolls the table.
All suggestions are welcome