0

I am using Selenium to test a web page that loads data in the background. I need to start looking for web elements AFTER the data is fully loaded. The problem is that you do see data in a browser, but there is a spinning wheel over it that doesn't disappear before data is fully loaded. Basically, I need Selenium to find web elements after the spinning wheel is gone. I am looking at the source code of that page, and here is what I see when the spinning wheel is spinning:

<div class="container-fluid" id="category">
  <rdo-overlay _nghost-qjr-14>
    <div _ngcontent-qjr-14="" class="rdo-overlay">
      <img _ngcontent-qjr-14="" src="/assets/images/loader-sm.gif">
    </div>
  </rdo-overlay>
</div>

Once the data is fully loaded and the spinning wheel is gone, the word "hidden" is added like this on the third line:

<div class="container-fluid" id="category">
  <rdo-overlay _nghost-qjr-14>
    <div _ngcontent-qjr-14="" class="rdo-overlay hidden">
      <img _ngcontent-qjr-14="" src="/assets/images/loader-sm.gif">
    </div>
  </rdo-overlay>
</div>

How can I use BeautifulSoap with the above code to check for that "hidden" part of the class name? Or is there a better way in my situation to figure the page is fully loaded?

Cœur
  • 37,241
  • 25
  • 195
  • 267
sprogissd
  • 2,755
  • 5
  • 24
  • 45
  • i understand that `webdriver.get(url)` in `selenium` python lib will wait until the `onload` event has been fired before returning control to the script. this means that main HTML, all CSS, images and other resources have been fully loaded. are you certain that this piece of information is outside of the scope of the `onload`? perhaps it's an AJAX call or something like that? – odradek Apr 18 '17 at 18:38
  • 1
    Possible duplicate of [Selenium Python: how to wait until the page is loaded?](http://stackoverflow.com/questions/26566799/selenium-python-how-to-wait-until-the-page-is-loaded) – Chris Apr 18 '17 at 18:39

0 Answers0