S
S
Sergey Yavin2019-11-08 13:27:46
Python
Sergey Yavin, 2019-11-08 13:27:46

How to wait for an element to change using selenium?

There is an element on the site that changes at intervals of 30 to 60 seconds. What methods can be used to determine that an element has changed. It is desirable that expectations are used. I implement it like this:

r = 1
def sleep_element(element, r):
  try:
    element = wait.until(EC.text_to_be_present_in_element((By.XPATH, element), str(r)))
  finally:
   		print("Метод отработал")

But this function waits until the element becomes 1 and finishes processing. I need it to simply determine whether something has changed in the element.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question