import requests
import re


def get_urls(root_url, regex_str):
    """
    Scrape all regex matches from a web page. Used to extract data from NOAA
    servers since their html structure isn't amenable to beautiful soup.
    """
    html = requests.get(root_url).text
    date_re = re.compile(regex_str)
    url_suffixes = set(date_re.findall(html))
    url_suffixes = [x.encode('ascii') for x in url_suffixes]
    return url_suffixes