diff --git a/python_scrapers/Highland.cgi b/python_scrapers/Highland.cgi index f7f77d8..06144c8 100644 --- a/python_scrapers/Highland.cgi +++ b/python_scrapers/Highland.cgi @@ -62,7 +62,7 @@ $month_h2 or no_results($year, $month, $day, "Cannot find month header"); my $month_list = $month_h2->right; -my $day_re = strftime('Planning Applications (?:[A-Za-z0-9 ]*?to )?%b[a-z]* ?%e[a-z]', 0, 0, 0, $day, $month-1, $year-1900); +my $day_re = qr/^Planning Applications.* $day[a-z]+$/; my ($day_link) = $month_list->look_down( "_tag", "a", diff --git a/python_scrapers/NorthAyrshire.cgi b/python_scrapers/NorthAyrshire.cgi index ee3b7c6..90f56c4 100644 --- a/python_scrapers/NorthAyrshire.cgi +++ b/python_scrapers/NorthAyrshire.cgi @@ -51,7 +51,7 @@ my $tree = HTML::TreeBuilder->new; $tree->parse(decode_utf8(get('http://www.north-ayrshire.gov.uk/na/Home.nsf/OtherMenuPage?ReadForm&MenuType=Environment-Planning&DocDisplay=NoDoc&CatLevel=2||') or die "couldn't fetch index page")); $tree->eof; -my $re = strftime('Planning Applications Received week ending %d %B %Y', 0, 0, 0, $day, $month-1, $year-1900); +my $re = strftime("Planning Applications Received week ending 0?$day %B %Y", 0, 0, 0, $day, $month-1, $year-1900); my ($day_link) = $tree->look_down( "_tag", "a", diff --git a/python_scrapers/Redbridge.cgi b/python_scrapers/Redbridge.cgi index b04cfa3..2488e9e 100644 --- a/python_scrapers/Redbridge.cgi +++ b/python_scrapers/Redbridge.cgi @@ -65,7 +65,7 @@ my $year_tree = HTML::TreeBuilder->new; $year_tree->parse(decode_utf8(get($year_absurl) or die "couldn't fetch day page")); $year_tree->eof; -my $day_re = strftime('Received %e[a-z]* %B %Y', 0, 0, 0, $day, $month-1, $year-1900); +my $day_re = strftime("Received 0?$day\[a-z]* %B %Y", 0, 0, 0, $day, $month-1, $year-1900); $day_re =~ s/ +/\\s+/g; my ($pdf_link) = $year_tree->look_down( "_tag", "a",