|
|
|
@ -53,16 +53,13 @@ def wait_for_element(driver, by, x, timeout=60):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_telemetered_bore(driver, bore_id, start_date, end_date):
|
|
|
|
|
"""Download records from telemetered bore.
|
|
|
|
|
"""Download single record from telemetered bore.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
driver: selenium webdriver object
|
|
|
|
|
bore_id: bore id (string)
|
|
|
|
|
bore_id: bore ID (string)
|
|
|
|
|
start_date: start date (string in ISO-8601 format)
|
|
|
|
|
end_date: end date (string in ISO-8601 format)
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
input values in model scale
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
url = 'https://realtimedata.waternsw.com.au/water.stm'
|
|
|
|
@ -158,6 +155,15 @@ def get_telemetered_bore(driver, bore_id, start_date, end_date):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def open_browser(download_dir):
|
|
|
|
|
"""Opens an automated Firefox browser instance.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
download_dir: path to where downloaded files will be saved
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
A selenium web browser object
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# Make download directory absolute
|
|
|
|
|
download_dir = os.path.abspath(download_dir)
|
|
|
|
|
|
|
|
|
@ -182,6 +188,17 @@ def open_browser(download_dir):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def telemetered_bore_downloader(bore_ids, start_date, end_date, download_dir):
|
|
|
|
|
"""Download multiple records from telemetered bore.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
bore_ids: bore ID values (array-like)
|
|
|
|
|
start_date: start date (string in ISO-8601 format)
|
|
|
|
|
end_date: end date (string in ISO-8601 format)
|
|
|
|
|
download_dir: path to where downloaded files will be saved
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
ValueError when bore ID is invalid
|
|
|
|
|
"""
|
|
|
|
|
driver = open_browser(download_dir)
|
|
|
|
|
|
|
|
|
|
# Set up log File
|
|
|
|
|