爬某大学所有学生照片
#-*- encoding:utf-8 -*- import requests from urllib import request a = "0" for xueyuan in range(1,30): if xueyuan < 10 : xueyuan = '0{}'.format(xueyuan) for zhuanye in range(1, 5): if zhuanye < 10: zhuanye = '0{}'.format(zhuanye) for banji in range(1, 15): if banji< 10: banji = '0{}'.format(banji) for xuehao in range(1, 40): if xuehao < 10: xuehao = '0{}'.format(xuehao) url = "http://xxxxxxxx/16"+str(xueyuan)+str(zhuanye)+str(banji)+str(xuehao)+".jpg" print("16"+str(xueyuan)+str(zhuanye)+str(banji)+str(xuehao)) path="/Users/xxxxx/Desktop/zhaopian/16"+str(xueyuan)+str(zhuanye)+str(banji)+str(xuehao)+".jpg" html = requests.head(url) re = html.status_code if re == 200: print(url + "\n") request.urlretrieve(url, filename=path) else: break
----
一共26188张照片
zuoer 》原创,转载请保留文章出处。
本文链接:爬某大学所有学生照片 https://www.zuoer.xin/?post=48
版权声明:若无特殊注明,本文皆为《
正文到此结束
管理员已关闭本篇文章评论!