Apart first on the code:
#Coding=utf-8ImportUrllibImportReImport TimeGlobalx x= 1defgethtml (URL): page=urllib.urlopen (URL) HTML=Page.read ()returnHTMLdefgetimg (HTML):Globalx Reg= R'src= "(. +?\.jpg)" alt='Imgre=Re.compile (reg) Imglist=Re.findall (imgre,html) forImgurlinchImglist:urllib.urlretrieve (Imgurl,'%s.jpg'%x) x+ = 1returnimglistdefDelayrun (): I= 1 whileI <= 65: Time.sleep (2) URL="http://www.mzitu.com/80661/"+STR (i) HTML=gethtml (URL) getimg (HTML) I+ = 1if __name__=='__main__': Globalx delayrun ()
First, python2.7 is installed on the computer. Then copy and paste the code into your own text editor and save the file as getmm.py
Then find the path of the file, Mac open a terminal, Win7 find the directory, enter CMD in the Address bar, enter the command line interface.
Input: Python getmm.py
Enter
Then open the folder where you are located. Enjoy it slowly.
A magical piece of code (Python 2.7) online screenshot demo