TransWikia.com

Finding all elements in a lazy loading webpage Selenium Python

Stack Overflow Asked by Bcat13 on December 11, 2020

I am trying to find all elements of a certain class name in a lazy loading webpage by scrolling through the entire page and then using:

driver.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", scroll)

time.sleep(5)

list = driver.find_elements_by_class_name('name')

However, this immediately jumps to the bottom of the webpage and doesn’t give a chance to load all of the elements within the entire page (there are thousands). Is there any way to slow down the scrolling with Selenium to be able to eventually find all of the elements on the page? Or is there a more efficient way to get all of the elements on a lazy loading webpage (instantaneously would be ideal). Thank you!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP