Regexp Crisis
Posted: Fri Jan 25, 2008 7:49 pm
So, for some reason a cron script I have to crawl for some data is choking and for the life of me I can't figure out why. In the meantime, clients have already noticed the issue and are calling in a panic. Any help you could offer would be most helpful.
Here's my code snippet:
$outer_matches has nothing in it when this runs on this date. However, if I use another date in the $futureURL string (2008-02-01). I know $html has the data in it -- i checked that.
Any idea what might be causing this to fail? Those two pages look the same to me. Any thoughts would be most helpful. Thanks.
Here's my code snippet:
Code: Select all
$futureURL = "http://www1.leg.wa.gov/legislature/showagenda.aspx?chamber=house&start=2008-01-30";
$html = file_get_contents("$futureURL");
if (!$html) {
die("Error retrieving URL");
}
preg_match_all('#([^>]+)</h1>(.+?)(<h1|</html>)#is', $html, $outer_matches, PREG_SET_ORDER);
Any idea what might be causing this to fail? Those two pages look the same to me. Any thoughts would be most helpful. Thanks.