def clean_attr(attr):
    if attr:
        if 'text' in attr:
            return 'text()'
        else:
            attr = attr.lstrip('@')
    if attr:
        return '@' + attr
    return None
Append @ to attributes and resolve text -> text() for XPath
dataset/ETHPy150Open huntrar/scrape/scrape/utils.py/clean_attr