Question
I need help writing code for a bot i have made in PYTHON. The problem is right now that I am trying to search for
I need help writing code for a bot i have made in PYTHON. The problem is right now that I am trying to search for item on webpage and if not found refresh that web page until when the web page loads the item is there. I have an if statement right now that when not found it refreshes but it only refreshes one time. I need it to continue refreshing until that item is found.
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")
That is the code I have now for refreshing if not found. Only refreshes once if someone could help me and let me know the correct code i need to have it refresh until item is found that would be great. Thank You
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started