get content of all input tag

def parse_from(html):
    tree = lxml.html.fromstring(html)
    data = {}
    for e in tree.cssselect('form input'):
        if e.get('name'):
            data[e.get('name')] = e.get('value')
    return data
原文地址:https://www.cnblogs.com/otfsenter/p/6566778.html