youtubeparser.py 文件源码

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

项目:HAL-9000 作者: AnsonRS 项目源码 文件源码
def parsePlaylist(url):
    try:
        page = await aiohttp.post(url, headers=headers)
        page = await page.text()

        #page = requests.get(url, headers=headers)
        soup = BeautifulSoup(page, 'html.parser')
        tags = soup.find_all("tr", class_="pl-video yt-uix-tile ")
        links = []

        for tag in tags:
            links.append("https://www.youtube.com/watch?v=" + tag['data-video-id'])
        if links != []:
            return links
        else:
            return False
    except:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号