望周知:
● 获取的是临时会员,是普通会员,非svip
● 每月可以参加一次活动,能获得1-2天会员,新用户能获得7天
● 在某宝、某黄鱼、某夕夕,这种链接能卖个几毛到几块,销量还不错
# 导包
import re
import requests
# 定义变量
url = 'https://pan.baidu.com/component/view?id='
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
}
# 随机id值,5000 以后应该没有了吧
for i in range(2000, 6000):
# 拼接字符串
urls = url + str(i)
# 不关注内容,直接根据 head 获取状态
response = requests.head(urls, headers=headers)
if response.status_code == 200:
content = requests.get(urls, headers=headers).text
# 提取 title
title = re.findall('<title>(.*)</title>', content)
# 设置关键词,与这个关键词相关的是会员活动,还有一堆其他链接,与会员活动无关
member = "会员狂欢季"
if member in str(title):
# 打印标题和链接
print(title, urls)
标签:title,度盘,获取,会员,urls,requests,headers
From: https://www.cnblogs.com/chongxs/p/17488029.html