JavaScript Website-Content Grabber
Is this a good approach?


Sadly, nope.


  Or is there a better way to accomplish this task?


Yes.

Instead of manually sifting through pages and copying source code, use wget's site mirroring functionality to download the entire site. There are a lot of ways to do this with the various options wget has. HTTrack is also an option if you want the tool to mangle the structure, names, etc. But we only need to download the pages so wget is fine.

Next, instead of having a page that parses the page source for content, consider writing a Node.js script instead*. Use glob to grab the paths of all HTML files, cheerio to traverse and grab content from the HTML like jQuery, and Node's very own fs to read and write to files. Also, regular expressions are the worst tools to parse through HTML. That's a known fact, don't even go there.

In summary, you run wget to download the entire site, and the Node.js script to parse all the HTML that was downloaded. You'll probably spend half a day to a day tops to build this script and the next day you'll have parsed content in seconds.  You just saved 2 months worth of work right there.

With the answer above, the rest becomes irrelevant.



*Any language would actually do (Python, Ruby, PHP, etc). But since you wrote in JS, Node.js would probably make more sense.