Advertisement

爬虫脚本用于批量下载图片

阅读量:
复制代码
 #coding=utf-8

    
 #---------------------------------------
    
 #   程序:搜狗图片爬虫
    
 #   作者:ewang
    
 #   日期:2016-7-6
    
 #   语言:Python 2.7
    
 #   功能:获取页面中的图片并保存到文件SouGouPic中。
    
 #---------------------------------------
    
  
    
 import string
    
 import urllib2
    
 import re
    
 import os
    
  
    
 class SouGouPic_Spider:
    
 	#申明相关属性
    
 	def  __init__(self):
    
 	    #给SougoPicUrl属性赋值
    
 		self.SougoPicUrl="http://pic.sogou.com/pics?query=%CD%BC%C6%AC%B4%F3%C8%AB&p=40230500&st=255&mode=255"
    
 		#用来保存图片URL信息
    
 		self.imgUrl=[]
    
 		print u'

全部评论 (0)

还没有任何评论哟~