title: Puppeteer page.content() - writing resolved promise into list
body: <p>I am trying to write a page's content into a list with puppeteer. </p>
  
  <p>My problem is too basic for other solutions out there. The reason I am failing is because I am too ignorant to get the resolved promise from an asynchronous function. I looked at the js documentation, I looked at similar answers, to no avail.</p>
  
  <p>I also tried multiple ways to resolve the <code>page.content()</code> promise within the asynchronous function, still failing miserably.</p>
  
  <pre><code>async function getPageContent(website) {
    const browser = await puppeteer.launch({ headless: false });
    const page = await browser.newPage();
  
    await page.goto(website, { waitUntil: "networkidle2" });
    const websiteContent = await page.content();
    await browser.close();
  
    return websiteContent;
  }
  
  var htmlList = [];
  var ws = "https://www.google.com/";
  var googleHtml = getPageContent(ws);
  
  htmlList.push(googleHtml);
  
  console.log(htmlList);
  </code></pre>
  
  <p>The result is <code>[Promise { pending }]</code>, which I understand is due to the promise status being unresolved. What I would like is the actual string of google's DOM. </p>
  
  <p>Thank you for any help in this specific promise / async / puppeteer crash course.</p>