feed.py 文件源码

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

项目:hardmob_promo 作者: leandrotoledo 项目源码 文件源码
def fetch():
        url = environ.get('URL')
        html = requests.get(url).content
        soup = BeautifulSoup(html, 'html.parser')

        posts = list()

        for link in soup.select('#threads a.title'):
            post = dict()

            post['title'] = link.text
            post['href'] = link.get('href')
            post['uid'] = int(post['href'].replace(url, '')[:6])  # TODO

            posts.append(post)

        return posts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号