import re


def _extract_balance_sheet_dates(elements):
    """
    Extract budget dates to a list. Date format is dd/mm/yyyy.
    """
    # Extract years. Use python reg. Can also use lxml exslt
    years = list()
    nodes = elements.xpath(".//*[@id='header_row']/th/span")
    for node in nodes:
        match = re.search(r"\d\d\d\d", node.text_content().strip())
        if match:
            years.append(match.string)

    # Extract month and day
    month_days = list()
    nodes = elements.xpath("//*[@id='header_row']/th/div")
    for node in nodes:
        match = re.search(r"\d\d/\d\d", node.text_content().strip())
        if match:
            month_days.append(match.string)

    # Budget timestamps
    return ["/".join(map(str, i)) for i in zip(month_days, years)]