title: WebScraping through multiple sites with Selenium
body: <p>I'm using Selenium in a project that consists of opening a range of websites, that contains pretty much the same structure, collecting data in each site and storing it.</p>
  <p>The problem I ran into is that some of the sites I wan't to access are unavailable, and when the program get to one of those it just stops.</p>
  <p>What I want it to do, is to skip those and follow on with the next iterations, but so far my tries have been obsolete... In my latest try I used the method is_displayed(), but apparently it will only tell me if an element is visible or not, instead of telling me if it's present or not.</p>
  <pre><code>if driver.find_element_by_xpath('//*[@id=&quot;main-2&quot;]/div[2]/div[1]/div[1]/div/div[1]/strong').is_displayed():
  </code></pre>
  <p>The example above doesn't work, because the driver needs to find the element before telling me if it visible or not, but the element is simply not there.</p>
  <p>Have any of you dealt with something similar?</p>
  <p><a href="https://statusinvest.com.br/fundos-imobiliarios/xpml11" rel="nofollow noreferrer">How one of the sites looks like normally</a></p>
  <p><a href="https://statusinvest.com.br/fundos-imobiliarios/afri11" rel="nofollow noreferrer">How it looks like when it is unavailable</a></p>