findspec.py 文件源码

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

项目:pixiebot 作者: umago 项目源码 文件源码
def _update_cache(release):
    LOG.debug('Updating cache for the release "%s"', release)
    url = BASE_URL % release
    html_page = urllib.request.urlopen(url)
    soup = BeautifulSoup(html_page)
    specs = {}
    for link in soup.findAll('a', attrs={'href': re.compile('.html$')}):
        href = link.get('href')
        title = ' '.join(href.replace('.html', '').split('-'))
        link = url + href
        specs[title] = link

    _CACHE[release] = {}
    _CACHE[release]['specs'] = specs
    _CACHE[release]['updated_at'] = datetime.datetime.utcnow()
    LOG.info('Cache updated for the release "%s"', release)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号