Need to analyze page HTML *after* all redirects
Posted: Fri Feb 12, 2010 4:58 pm
Hey folks,
I am trying to do a small application which monitors specific URLs to notify when content has changed.
However, some of the URLs the system needs to monitor have 1 or more redirects, so the final page URL is different to the original URL.
I need to be able to read and analyze the HTML in the *FINAL* page, after all redirects have been processed.
I tried the following code, but this only picks up the source code of the original URL.
$contents = file_get_contents($MonitorUrl);
if(strpos($contents, $SearchText)!== false)
{
echo 'found<br/><br/>';
}
else
{
echo 'not found<br/><br/>';
}
Can anyone offer any advice?
I am trying to do a small application which monitors specific URLs to notify when content has changed.
However, some of the URLs the system needs to monitor have 1 or more redirects, so the final page URL is different to the original URL.
I need to be able to read and analyze the HTML in the *FINAL* page, after all redirects have been processed.
I tried the following code, but this only picks up the source code of the original URL.
$contents = file_get_contents($MonitorUrl);
if(strpos($contents, $SearchText)!== false)
{
echo 'found<br/><br/>';
}
else
{
echo 'not found<br/><br/>';
}
Can anyone offer any advice?