0

I am trying to iterate through all items which have the class name status ready, and then do something at each iteration.

My problem is that, even if I wait a long time to search for that class name, it is not found:

wait(driver, 600).until(EC.presence_of_element_located((By.CLASS_NAME, "status ready")))

Here is the the top part of the inspection from chrome http://pastebin.com/4aMyb8yV

(the important part is class='status ready') The website is scrolls infinitely, but I would like to iterate through elements, even if I don't see them at the beginning.

1 Answer 1

1

You cannot use compound classes with search By.CLASS_NAME, use By.CSS_SELECTOR instead:

wait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, ".status.ready")))
Sign up to request clarification or add additional context in comments.

2 Comments

Ok great, could you help me figure out then how to iterate trough them, even the ones that aren't loaded until the page is scrolled down ?
You mean that page should get data from some XHR to render more content? I'd suggest you to try in loop driver.find_element_by_xpath('//body').send_keys(Keys.END) to scroll page down and trigger new XHR, but it could be not that simple

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.