def innerscripts_to_array(p):
    """Extracts inner scripts from page"""
    res = []
    all = p.xpath('//script')
    for tag in all:
        if 'src' in tag.attrib:
            continue
        else:
            item = {'text' : tag.text_content()}
            if 'type' in tag.attrib: item['type'] = tag.attrib['type']
            res.append(item)
    return {'total' : len(res), 'list' : res}