title: Get href attribute in pupeteer Node.js
body: <p>I know the common methods such as <code>evaluate</code> for capturing the elements in <code>puppeteer</code>, but I am curious why I cannot get the <code>href</code> attribute in a JavaScript-like approach as</p>
  
  <pre><code>const page = await browser.newPage();
  
  await page.goto('https://www.example.com');
  
  let links = await page.$$('a');
  for (let i = 0; i &lt; links.length; i++) {
    console.log(links[i].getAttribute('href'));
    console.log(links[i].href);
  }
  </code></pre>