def scrape_result_count(soup):
    """Scrapes the result count from an Archive-It results page stored in the
    BeautifulSoup object `soup`.
    """
    try:
        pagestring = soup.find_all('div', 'paginator')[0].text
        result_count = pagestring[pagestring.find('(') + 1:].replace(
            ' Total Results', '').rstrip(')')
        result_count = pagestring[pagestring.find('(') + 1:pagestring.find(
            ' Total Results')]
        result_count = result_count.replace(',', '')
    except IndexError:
        result_count = None
    return result_count
