diff --git a/waternsw_grabber/waternsw_grabber.py b/waternsw_grabber/waternsw_grabber.py index 5102c06..8f73f2d 100644 --- a/waternsw_grabber/waternsw_grabber.py +++ b/waternsw_grabber/waternsw_grabber.py @@ -9,6 +9,7 @@ import shutil import logging import warnings import requests +import numpy as np import pandas as pd from tqdm import tqdm from selenium import webdriver @@ -299,7 +300,10 @@ def extract_definitions(input_dir, output_dir): site_data = meta['Sites:'][0] lat = float(re.search(r'(?<=Lat:)\S+', site_data).group()) lon = float(re.search(r'(?<=Long:)\S+', site_data).group()) - elev = float(re.search(r'(?<=Elev:).+(?=m)', site_data).group()) + try: + elev = float(re.search(r'(?<=Elev:).+(?=m)', site_data).group()) + except AttributeError: + elev = np.nan address = re.search(r'(?<=\d\.\d\.\d - ).+(?=\sLat)', site_data).group() bore_id = re.search(r'^\S+', site_data).group()