title: using document.querySelector to get a value/name from a website
body: <p>I'm trying to get the value of the 'a' tag from a website. I'm running the code below in the console of Google Chrome.</p>
  
  <pre class="lang-js prettyprint-override"><code>document.querySelector('#container &gt; article:nth-child(1) &gt; div &gt; h1 &gt; a');
  </code></pre>
  
  
  
  <p>Executing that returns this tag:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a class="name-link" href="/shop/blarg/foo/bar"&gt;blarg&lt;/a&gt;
  </code></pre>
  
  
  
  <p>I'm trying to get 'blarg' returned, preferably in a variable. I have tried the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>document.querySelector('#container &gt; article:nth-child(1) &gt; div &gt; h1 &gt; a').value;
  </code></pre>
  
  
  
  <p>However it simply returns 'undefined'. Any help would be much appreciated, thank you</p>