I am trying to fetch and print all the listed product from the given url ‘https://www.swiggy.com/instamart/city/gurgaon/c/fresh-vegetables?custom_back=true’ but currently facing issue with the scroll. It is fetching only first 20 products from the given link and rest I am unable to fetch I have tried with the given code
last_height = driver.execute_script("return document.body.scrollHeight")
#
# while True:
# driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
# time.sleep(20) # Wait for the page to load new content
# new_height = driver.execute_script("return document.body.scrollHeight")
# if new_height == last_height:
# break
# last_height = new_height