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.
document.querySelector('#container > article:nth-child(1) > div > h1 > a');
Executing that returns this tag:
<a class="name-link" href="/shop/blarg/foo/bar">blarg</a>
I'm trying to get 'blarg' returned, preferably in a variable. I have tried the following:
document.querySelector('#container > article:nth-child(1) > div > h1 > a').value;
However it simply returns 'undefined'. Any help would be much appreciated, thank you