I'm trying to extract links to the articles including the text, from this site using PHP Simple HTML DOM PARSER.
I want to extract all h2
tags for articles in the main page and I'm trying to do it this way:
$html = file_get_html('http://www.winbeta.org');
$articles = $html->getElementsByTagName('article');
$a = null;
foreach ($articles->find('h2') as $header) {
$a[] = $header;
}
print_r($a);
according to the manual it should first get all the content inside article
tags then for each article extract the h2 and save in array. but instead it gives me :