Skip to content

Commit 0c2a0ee

Browse files
committed
Now uses hard coded link as the scaper fails since they redesigned the page
1 parent 80d3f76 commit 0c2a0ee

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sepa-river-fetcher

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import feshiedb
1010
# Only need one station at the moment so can b e hardcoded - done is such a way
1111
# as to make conversion if needed easier
1212
URL = "http://apps.sepa.org.uk/waterlevels/default.aspx?sd=t&lc=234217"
13+
CSV_URL = "http://apps.sepa.org.uk/database/riverlevels/234217-SG.csv"
1314
LOCATION_ID = "Feshie Bridge"
1415

1516
DEFAULT_LOG_LEVEL = logging.ERROR
@@ -26,10 +27,7 @@ class sepa_riverdepth_fetcher(object):
2627
self.logger.critical("No database connection")
2728
exit(1)
2829

29-
def fetch_river_depth(self, url):
30-
self.logger.debug("Getting data from %s", url)
31-
page = self.get_page(url)
32-
csv_link = self.get_csv_link(page)
30+
def fetch_river_depth(self, csv_link):
3331
if csv_link is not None:
3432
self.logger.debug("Downloading CSV from %s", csv_link)
3533
csv = self.get_page(csv_link)
@@ -95,4 +93,4 @@ if __name__ == "__main__":
9593
else:
9694
CONFIG = OPTIONS.config_file
9795
SEPA = sepa_riverdepth_fetcher(CONFIG, LOG_LEVEL)
98-
SEPA.fetch_river_depth(URL)
96+
SEPA.fetch_river_depth(CSV_URL)

0 commit comments

Comments
 (0)