I'm looking for a javascript template/lead that would accomplish the same thing as this PHP script below, but in an async way (?) so that the information is always accurately the same as the targeted website's... with no delay.
<?php
$html = file_get_contents('https://www.restockcrc.com/all/');
$re = '/<h4 class="card-title">.+?<a href="(\S+)">(.*?)<\/a>/ms';
preg_match_all($re, $html, $matches, PREG_SET_ORDER, 0);
foreach ($matches as $item) {
echo sprintf('<a href="%s">%s</a><br>', $item[1], $item[2]); // Print results
}
I've been playing with Puppeteer but the documentation is huge and it's hard to find what I need.
I have NodeJS installed and Jade/Express.