python下载vip素材_Python爬虫,python秀设计素材爬取及下载

f89d74c6288643c59e68638ead9092cf.png

Python爬虫,python秀设计素材爬取及下载

秀设计素材爬取及下载

2f47b272af0e74ab809e450031b16db5.png
#爬取秀设计素材
import requests
import re
import os

url="https://www.xiusheji.com/freebies/4641.html"
html=requests.get(url).text
print(html)
btze=r'<h1>(.+?)</h1>'
title=re.findall(btze,html,re.S)
title=str(title)
print(title)
lxze=r'</a> &gt; <span>(.+?)</span> '
leix=re.findall(lxze,html,re.S)
print(leix)
nrze=r'<section class="art-main">(.+?)          </section>'
nr=re.findall(nrze,html,re.S)
print(nr)
scze=r'''百度云盘</a>
<a target="_blank" ng-if="'(.+?)'" href=".+?" md-button class="normal">本地下载</a>'''
sc=re.findall(scze,html,re.S)
print(sc)
scl=sc[0]
print(scl)
scgs=scl[-4:]
print(scl[-4:])
tpze=r'img src="(.+?)"'
tp=re.findall(tpze,str(nr),re.S)
print(tp)
i=0
tpm=[]
n=1
#os.makedirs("./img/"+str(n)+"/", exist_ok=True)
os.makedirs("./img/"+title+"/", exist_ok=True)
scnr=requests.get(scl)
f=open("./img/"+title+"/"+str(n)+scgs,"wb")
f.write(scnr.content)
f.close()

for x in tp:
    print(x)
    i=i+1
    print(x[-3:])
    tpmc=str(i)+x[-17:]
    print(tpmc)
    tpnr=requests.get(x)
    f=open("./img/"+title+"/"+tpmc,"wb")
    f.write(tpnr.content)
    f.close()

设计本资料下载,模型下载

17bd52d25a23524b6da4a56e1bc03ffa.png
#设计本资料下载
import requests
import re
import os


url='https://vr.shejiben.com/r262.html'
html=requests.get(url).text
print(html)
nrze=r'''<tr class="bg">
(.+?)</td>
<td><span style=" width:120px; overflow:hidden; float:left;">'''
nr=re.findall(nrze,html,re.S)
nr=str(nr)
print(nr)
scze=r'var loadUrl = '(.+?)';'
sc=re.findall(scze,html,re.S)
print(sc)
scurl=str(sc[0])+'.rar'
print(scurl)
scmze=r'var autoInfoName = '(.+?)';'
scm=re.findall(scmze,html,re.S)
print(scm)
scmc=scm[0]
sctpze=r'var picPath = '(.+?)';'
sctp=re.findall(sctpze,html,re.S)
sct=sctp[0]
sctmz=sct[-8:]
print(sctmz)

os.makedirs('E:Pythoncsimage/'+scmc, exist_ok=True)
r=requests.get(scurl)
with open('E:Pythoncsimage/'+scmc+'/'+'.rar','wb') as f:
    f.write(r.content)

ru=requests.get(sct)
with open('E:Pythoncsimage/'+scmc+'/'+sctmz,'wb') as f:
    f.write(ru.content)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值