Use python to crawl small images to meet your desires (crawlers ),
import requests
import re
import os,sys
links=[]
titles=[]
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}
Def get_url (page ):
Url = 'HTTP: // www.zbjuran.com/mei/xinggan/list_13_developers.html'% (page)
Data = requests. get (url, headers = headers). text
Data_use = re. findall ('<div class = "name"> <a target = "_ blank" href = ".*? "Title = ".*? </A> </div> ', data)
For use in data_use:
Link = 'HTTP: // www.zbjuran.com/'{use.split ('href = "') [1]. split ('" title') [0]
Links. append (link)
Title = use. split ('title = "') [1]. split ('"> ') [0]
Titles. append (title)
Mkpath = '/Users/b1ancheng/mzpc/% s' % title
Wtxtpath = '/Users/b1ancheng/mzpc/% s/%s.txt' % (title, title)
Def get_pic ():
Url_data = requests. get (link). text
Page = int (url_data.split ('<div class = "page"> <li> <a> col') [1]. split (' page: ') [0])
For I in range (1, page + 1 ):
Print ('downloading Page % s' % I)
Pic_url = (link [:-5] + '_ % s' + link [-5:]) % I
Print (pic_url)
Try:
Pic_data_link = 'HTTP: // www.zbjuran.com '+ requests. get (pic_url, headers = headers, timeout = 5 ). text. split (' </div>') [0]
With open ('/Users/b1ancheng/mzpc/% s _ % s. JPG' % (title, title, I), 'wb') as pic_download:
Pic_download.write (requests. get (pic_data_link). content)
Failed t Exception as error:
Print (error)
Continue
# Creating a directory
IsExists = OS. path. exists (mkpath)
If not isExists:
OS. makedirs (mkpath)
Get_pic ()
Else:
Return False
If _ name _ = '_ main __':
For page in range (1, 88 ):
Get_url (page)