|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 tianyamingyue 于 2020-6-15 06:12 编辑
import requests
import re
import os
a='http://www.001photo.com/900/latest.asp'
header={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3314.0 Safari/537.36 SE 2.X MetaSr 1.0',
'Referer':'http://www.001photo.com/'}
b=requests.get(a,headers=header).content
c=b.decode('gb2312',errors = 'ignore')
d=set(re.findall(r'/900/photoshow.asp\?id=\d{6}',c))
print(d)
x=1
for e in d:
f='http://www.001photo.com/'+e
g=requests.get(f,headers=header).content
h=g.decode('gb2312',errors='ignore')
j=set(re.findall(r'/upload/img/small/2020/\d/\w*?-\d{12,13}-001photo.jpg',h))
print(j)
x+=1
i=1
for m in j:
k=m.replace('small/','')
z='http://www.001photo.com'+k
y=requests.get(z).content
filename='e:\ '+str(i)+'2020.6'+str(x)+'.jpg'
with open(filename,'wb')as f:
f.write(y)
print('正在打印第'+str(x)+str(i)+'张照片')
i+=1 |
|