veer图库网站爬取

记录一下当时同学托我帮写的爬取veer图库链接的python代码

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File    :img.py
@IDE     :PyCharm 
@Author  :Naihe
@Date    :2021/12/17 13:24 
"""
import requests
import re

if __name__ == '__main__':
    url = input("输入你的veer URL")  # 例如https://www.veer.com/topic/21871/
    res = requests.get(url="https://www.veer.com/", headers={
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
    })
    text = res.text
    r = re.compile(r'<source data-srcset="//(.*?jpg|png)\?')
    data = r.findall(text)
    for i in data:
        print(i)

 

 

posted @ 2022-09-20 11:40  Naihe\  阅读(78)  评论(0编辑  收藏  举报
// 音乐播放器