title: Cypress get href attribute
body: <p>I have a test case in which I have a link which opens in a new tab. Since Cypress doesn't support multiple tabs, I want to get the <code>href</code> attribute of that link and then open it in the same tab. I'm trying to do it this way, but for some reason it doesn't work.</p>
  <pre><code>it('Advertise link should refer to Contact page', () =&gt; {
      var link = document.querySelector(&quot;div.footer-nav &gt; ul &gt; li:nth-child(2) &gt; a&quot;).href;
      cy.visit(link);
      cy.title().should('include', 'Text');
  });
  </code></pre>