So I recently made a bot for supreme just for fun and to use myself, it is completed the only thing I need to fix is the refresh.
Right now I have an if statement that refreshes the page if item not found. But it only refreshes once. I need help getting it to refresh until it finds the item.
This is the code I have right now for the refresh.
items = driver.find_elements_by_xpath("//article[.//a[contains(.,'MLK')]][.//a[.='Rainbow']]//a")
if items:
items[0].click()
else:
driver.get("http://www.supremenewyork.com/shop/all/sweatshirts")
If anyone knows the syntax for it that would be great, pretty sure I need a while loop but not sure how to set it up.
Right now I have an if statement that refreshes the page if item not found. But it only refreshes once. I need help getting it to refresh until it finds the item.
This is the code I have right now for the refresh.
items = driver.find_elements_by_xpath("//article[.//a[contains(.,'MLK')]][.//a[.='Rainbow']]//a")
if items:
items[0].click()
else:
driver.get("http://www.supremenewyork.com/shop/all/sweatshirts")
If anyone knows the syntax for it that would be great, pretty sure I need a while loop but not sure how to set it up.
![[Image: UJB3B5t.png]](https://i.imgur.com/UJB3B5t.png)


