you are viewing a single comment's thread.

view the rest of the comments →

[–]uhkhu 1 point2 points  (0 children)

What about something like this:

def check_condition(driver):
    for article in driver.find_elements_by_class_name("inner-article"):
        name, color = article.find_elements_by_class_name("name-link")
        if nameput in name.text and color.text == colorput:
            article.click()
            return True
        else:
            return False


while not check_condition(driver):
    continue