[wd_asp elements=’search’ ratio=’100%’ id=1]

Webscraping words from a website 2

29th October 2013

Php - Miscellaneous

php codehaven

loadHTML($page);
$divs = $doc->getElementsByTagName('div');
foreach($divs as $div) {
// Loop through the DIVs looking for one withan id of "content"

if ($div->getAttribute('id') === 'bodyContent' ) {
echo $div->nodeValue;
}
}

?>