title: Cypress check that a string does not exist in body, excluding a block or div
body: <p>I have a series of strings to check that they don't exist in various pages; but I don't want to check a single div.</p>
  <p>I have several pages where to check that strings &quot;Miami&quot;, &quot;Tampa&quot; , &quot;Naples&quot;, &quot;Orlando&quot; does NOT exist, but I have a <code>div</code> at the bottom of each page that contains</p>
  <pre><code>&lt;div class=&quot;footer&quot;&gt;&lt;h3 class=&quot;availability&quot;&gt;
                   We are also available in
              &lt;/h3&gt; &lt;a href=&quot;...&quot; class=&quot;province&quot;&gt;
                  Miami
              &lt;/a&gt;&lt;a href=&quot;...&quot; class=&quot;province&quot;&gt;
                  Tampa
              &lt;/a&gt;&lt;a href=&quot;...&quot; class=&quot;province&quot;&gt;
                  Naples
              &lt;/a&gt;&lt;a href=&quot;...&quot; class=&quot;province&quot;&gt;
                  Orlando
              &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I created a test that loops in each page and checks that</p>
  <pre><code>cy.get('body').should('not.contain', 'Miami')
  cy.get('body').should('not.contain', 'Tampa')
  cy.get('body').should('not.contain', 'Naples')
  cy.get('body').should('not.contain', 'Orlando')
  </code></pre>
  <p>But these test obviously fails because cypress find those strings in that <code>div</code>.</p>
  <p>Is there a way to exclude it from search? I tried</p>
  <pre><code>cy.get('body')
      .not('footer')
      .should('not.contain', 'Miami')
  </code></pre>
  <p>But this doesn't work!</p>
  <p>As a workaround, I thought i could remove the div from the dom, but I'm not sure if its a good idea and anyway I don't know how to do it in cypress.</p>