I'm very new a web scraping and have hit a issue with being able to check to see if I have reached a specific element in a list. The list changes length regularly, so I have been trying to check for the text/label of the element in the list, but the code I have tried has not worked.
Once the element "M" has been reached I want to exit the loop.
I have tried using the X-path, but the element number changes, last week it was: /html/body/ul/li[292]/div
this week it is [293], but the number will be changing often.
I have tried different approaches, my last one was using the class name "group"
element.driver.find_elements_by_class_name("group")
Any help or direction to any resources that may help are greatly appreciated!