title: Format Puppeteer output for CSV export
body: <p>I have written a Puppeteer script that scrapes text from a website (it's a GUI that displays the server's log files -- it's a Squarespace site, so that's the only way I can access the log files).</p>
  
  <p>This is how the lines appear in the GUI:
  <a href="https://i.stack.imgur.com/4dRsv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4dRsv.png" alt="enter image description here"></a></p>
  
  <p>The script reads this (and every row below it) and outputs it to a the console.log() currently.</p>
  
  <p>That record above outputs like this:</p>
  
  <pre><code>11/9/2018 at 12:21:44pm70.119.157.106AboutHostname:70.119.157.106Location:Carrollton, Texas, United StatesTags:-Referrer:www.website.com/Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
  </code></pre>
  
  <p>And they get placed end-to-end in the output in a giant block like this:</p>
  
  <pre><code>11/9/2018 at 12:21:44pm70.119.157.106AboutHostname:70.119.157.106Location:Carrollton, Texas, United StatesTags:-Referrer:www.website.com/Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.3611/9/2018 at 12:21:33pm70.119.157.106HomesitesHostname:70.119.157.106Location:Carrollton, Texas, United StatesTags:-Referrer:www.website.com/about/Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.3611/9/2018 at 12:21:26pm70.119.157.106AboutHostname:70.119.157.106Location:Carrollton, Texas, United StatesTags:-Referrer:www.website.com/Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.3611/9/2018 at 12:21:15pm70.119.157.106HomeHostname:70.119.157.106Location:Carrollton, Texas, United StatesTags:-Referrer:-Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
  </code></pre>
  
  <p>I am now at the step where I'm trying to figure out how to write this to CSV instead of to terminal with <code>console.log(textContent);</code>.</p>
  
  <p>What is the best way to write this to a CSV?</p>
  
  <p>(The following step will be parsing all this, but...baby steps...)</p>