|
|
@ -116,10 +116,7 @@ def get_telemetered_bore(driver, bore_id, start_date, end_date):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def open_browser(download_dir):
|
|
|
|
def open_browser(download_dir):
|
|
|
|
# Warn if user does not have admin privileges
|
|
|
|
# Set up Firefox to silently download files to specified folder
|
|
|
|
if not has_admin():
|
|
|
|
|
|
|
|
warnings.warn('This program should be run as an administrator.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profile = webdriver.FirefoxProfile()
|
|
|
|
profile = webdriver.FirefoxProfile()
|
|
|
|
profile.set_preference('browser.download.folderList', 2)
|
|
|
|
profile.set_preference('browser.download.folderList', 2)
|
|
|
|
profile.set_preference('browser.download.manager.showWhenStarting', False)
|
|
|
|
profile.set_preference('browser.download.manager.showWhenStarting', False)
|
|
|
@ -130,9 +127,11 @@ def open_browser(download_dir):
|
|
|
|
'application/x-zip-compressed,'
|
|
|
|
'application/x-zip-compressed,'
|
|
|
|
'multipart/x-zip'))
|
|
|
|
'multipart/x-zip'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create download folder if it does not exist
|
|
|
|
|
|
|
|
os.makedirs(download_dir, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
# Open browser
|
|
|
|
# Open browser
|
|
|
|
driver = webdriver.Firefox(firefox_profile=profile)
|
|
|
|
driver = webdriver.Firefox(firefox_profile=profile)
|
|
|
|
|
|
|
|
|
|
|
|
url = 'https://realtimedata.waternsw.com.au/water.stm'
|
|
|
|
url = 'https://realtimedata.waternsw.com.au/water.stm'
|
|
|
|
driver.get(url)
|
|
|
|
driver.get(url)
|
|
|
|
|
|
|
|
|
|
|
|