

def scraper(text, anxpath):
    'Take html and an XPATH, and return match.'
    if (text[:4].lower() == 'http'):
        text = requests.get(text).text
    import lxml.html
    searchme = lxml.html.fromstring(text)
    match = searchme.xpath(anxpath)
    if match:
        return match[0]
    else:
        return None

dataset/ETHPy150Open miklevin/pipulate/common.py scraper/original