记录一下当时同学托我帮写的爬取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)
标签:__,www,veer,res,图库,爬取,re From: https://www.cnblogs.com/1314h/p/16710525.html