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
posted @ 2017-03-17 16:02  idlewith  阅读(129)  评论(0编辑  收藏  举报