items = self.driver.find_elements_by_tag_name("li") for item in items: text = item.text print(text) if text == 'idk': item.click() break