'web scraping on infinite scroll using sites

I am trying to scrape a data from opensea. I can scroll page but I dont know how could collect data while scrolling.

my code

from selenium import webdriver from selenium.webdriver.common.keys import Keys import time

driver=webdriver.Chrome()

driver.get('https://opensea.io/collection/otherdeed?search[numericTraits][0][name]=Environment%20Tier&search[numericTraits][0][ranges][0][max]=5&search[numericTraits][0][ranges][0][min]=5&search[numericTraits][1][name]=Plot&search[numericTraits][1][ranges][0][min]=60000&search[numericTraits][1][ranges][0][max]=65000&search[sortAscending]=false&search[sortBy]=PRICE&search[stringTraits][0][name]=Koda%3F&search[stringTraits][0][values][0]=No')

time.sleep(3)


element = driver.find_element_by_tag_name('body')

while True:
    element.send_keys(Keys.PAGE_DOWN)
    time.sleep(3)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source