title: Python xpath - Exclude content with style="display:none"
body: <p>I'm using xpath to get some information from a website and I came across a block of code that contains <code>style="display:none</code> or <code>block</code> and I want to only include the code that has <code>display:block</code>; I watched some examples but I couldn't get it working on my code. I want to use an <code>if</code> statement to run the code if it has <code>display:block</code> but I don't know if that is possible. This is what I have:</p>
  
  <pre><code>    if guide_page.xpath(".//div[@class='build-box']/@style/text()") == "display: block;":
          for build_names in guide_page.xpath(".//div[@class='build-gradient']"):
              for title in build_names.xpath("div/h2/text()"):
                  print("\n")
                  print(title)
  </code></pre>
  
  <p>And this is the <code>div</code> that has it:</p>
  
  <pre><code>&lt;div class="build-box" style="display: block;"&gt;
  </code></pre>
  
  <p>I'm not sure if I should paste more of the html or if that's enough, otherwise, please tell me and thanks for any help :)</p>