from datetime import datetime


def get_record(card):
    """
    Extract details from a job "card" from Indeed.com page.
    """
    atag = card.h2.a
    job_title = atag.get('title')
    job_url = 'https://www.indeed.com' + atag.get('href')

    company = card.find('span', {'class': 'company'}).text.strip()
    job_location = card.find('div', 'recJobLoc').get('data-rc-loc')
    job_summary = card.find('div', 'summary').text.strip()

    post_date = card.find('span', 'date').text
    today = datetime.today().strftime('%Y-%m-%d')

    # If salary range is not provided, set to empty string.
    try:
        job_salary = card.find('span', 'salaryText').text
    except (AttributeError):
        job_salary = ''
    
    record = (job_title, company, job_location, post_date, today, job_summary, job_salary, job_url)

    return record