Although you normally should not parse an HTML file with regexes, in this case you could make an exception (since the page in particular still uses <font>
, the structure is broken anyway and an XML parser would not help much). This piece of code here assumes that you already have fetched the webpage and put it into the string variable $webpage_as_string
:
preg_match('|Results.+?of +about +\<b\>([0-9,]+)\<\/b\> +for|', $webpage_as_string, $matches);
$matches[1]
would contain the result as a string. You'd need to filter out the commas and parse it into a number... Of course, this code would break as soon as Google changes it's site template.
http://php.net/manual/en/function.preg-match.php contains more information on the function, the pattern manual is here: http://www.php.net/manual/en/reference.pcre.pattern.syntax.php