import io


def read_pages(filename, co2causes):
    """Read company web page file, retaining only those in co2causes"""
    co2page = dict()
    for line in io.open(filename, mode='rt', encoding='latin_1'):
        parts = line.strip().split('\t')
        if parts[0] in co2causes and len(parts) > 1:
            co2page[parts[0]] = parts[1]
    return co2page