Skip to content

Instantly share code, notes, and snippets.

@clkefe
Created January 10, 2022 16:37
Show Gist options
  • Save clkefe/2a13254920aa1d29dfe10aa26b3225eb to your computer and use it in GitHub Desktop.
Save clkefe/2a13254920aa1d29dfe10aa26b3225eb to your computer and use it in GitHub Desktop.
Rarible refresh metadata
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
xPath = "/html/body/div[1]/div[2]/div[2]/div[2]/div/div[2]/div[1]/div/div[1]/div/div[1]/div[2]/div/div/button"
xPath2 = "/html/body/div[3]/div/div/div/div/div/div/div[1]/div/button[3]"
xPath3 = "/html/body/div[1]/div[2]/div[2]/div[2]/div/div[2]/div[1]/div/div[1]/div/div[1]/div[1]/h1"
driver = webdriver.Chrome(ChromeDriverManager().install())
def main(start):
for i in range(100):
try:
i += start
driver.get(f"https://rarible.com/token/0x8a90cab2b38dba80c64b7734e58ee1db38b8992e:{i}?tab=details")
nameElement = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, xPath3)))
name = nameElement.text
print(name)
if "#" in name:
continue
dropdownButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, xPath)))
dropdownButton.click()
time.sleep(1)
refreshButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, xPath2)))
refreshButton.click()
time.sleep(0.5)
except Exception as e:
print("Error", e)
driver.close()
main(200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment