I am currently working with PHP Simple HTML DOM Parser trying to scrape a site. Here is what i have so far:
$html = file_get_html('https://www.example.com');
// Find all article blocks
foreach($html->find('.plan') as $article) {
$item['title'] = $article->find('.price', 0)->plaintext;
$item['intro'] = $article->find('li', 0)->plaintext;
$item['details'] = $article->find('.button', 0)->href;
$articles[] = $item;
}
print_r($articles);
The above works fine, however if more than one <li> exists it only returns the first <li> missing out the rest.
Is there a way i can get all list items?