I am writing a script that is constantly looping and will need to stop when it detects that there is text in a certain element on the page. I couldn't find any help in the selenium python docs about doing this but there must be a way. In case you still don't understand what I need to do, here is some code:
While #element is not visible:
#do stuff
#when element is visible break out of statement and do something else
EDIT: I know the exact text and the exact xpath of the element i am looking for. However, I am just looking for a general response so I don't mind an answer lacking detail.