I'm following a simplified version of the scraping tutorial by NetTuts here, which basically finds all divs with class=preview
This is my code. The problem is that when I count $items
I get only 1, so it's getting only the first div with class=preview
, not all of them.
$articles = array();
$html = new simple_html_dom();
$html->load_file('http://net.tutsplus.com/page/76/');
$items = $html->find('div[class=preview]');
echo "count: " . count($items);