Use absolute paths for Firefox download directory

master
Dan Howe 6 years ago
parent aecf3070dc
commit f2958e95c2

@ -117,6 +117,9 @@ def get_telemetered_bore(driver, bore_id, start_date, end_date):
def open_browser(download_dir): def open_browser(download_dir):
# Make download directory absolute
download_dir = os.path.abspath(download_dir)
# Set up Firefox to silently download files to specified folder # Set up Firefox to silently download files to specified folder
profile = webdriver.FirefoxProfile() profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2) profile.set_preference('browser.download.folderList', 2)
@ -137,23 +140,3 @@ def open_browser(download_dir):
driver.get(url) driver.get(url)
return driver return driver
def main():
driver = open_browser()
bore_ids = [
'GW036367.1.1',
'GW036211.1.1',
'GW036588.4.4',
'GW036572.1.1',
]
start_date = '2018-01-01'
end_date = '2018-06-01'
# Download bore logs
for bore_id in bore_ids:
print('Downloading {}...'.format(bore_id))
get_telemetered_bore(driver, bore_id, start_date, end_date)
driver.quit()

Loading…
Cancel
Save