Avatar of pc-buddy
pc-buddy

asked on 

PHP Sctrapper

Hi,

I cant make this code work, I'm using the simple dom scrapper, it should

1. grab all current live urls
2. use the simple html dom to find a set div on the page
3. grab the text within that div
4. print each one out on the page.

<?php
// example of how to use basic selector to retrieve HTML contents
include('simple_html_dom.php');
 
// grab the list of urls
$html = file_get_html('https://system.playtimenurseries.com/children/');

// find all link
foreach($html->find('a') as $e) {
$link = $e->href . '/invoices/2016/11';

foreach ($link as $p)
{
$html2 = file_get_html($p);

foreach($html2->find('div#gbar') as $i){
    echo $i->innertext . '<br>';
       }
    }
}
?>

Open in new window

LaravelPHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon