downloader.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:enigma2 作者: OpenLD 项目源码 文件源码
def DownloadSetting(url):
    list = []
    try:
        req = urllib2.Request(url)
        req.add_header('User-Agent', 'VAS')
        response = urllib2.urlopen(req)
        link = response.read()
        response.close()
        xx = re.compile('<td><a href="(.+?)">(.+?)</a></td>.*?<td>(.+?)</td>', re.DOTALL).findall(link)
        for link, name, date in xx:
            print link, name, date
            prelink = ''
            if not link.startswith("http://"):
                prelink = url.replace('asd.php','')
            list.append((date, name, prelink + link))

    except:
        print"ERROR DownloadSetting %s" %(url)

    return list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号