@@ -69,10 +69,7 @@ def parse_one(self, response):
69
69
item ['image_id' ] = str (uuid .uuid1 ())
70
70
item ['category_code' ] = category_code
71
71
item ['image_from' ] = self .image_from
72
- # print 'parse_one图片Id' + item['image_id']
73
- # print 'parse_one图片标题' + item['image_title']
74
- # print 'parse_one图片图片保存在数据库的目录' + item['image_url_dir']
75
- # print 'parse_one图片存储的目录' + item['dir_path']
72
+
76
73
headers = {
77
74
"Accept" :"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" ,
78
75
"Accept-Language" :"zh-CN,zh;q=0.8" ,
@@ -85,7 +82,6 @@ def parse_one(self, response):
85
82
#1.获取每个image的标题,url入口,分类
86
83
#2.随机生成一个image_id
87
84
def parse_two (self , response ):
88
- print response .text
89
85
item = response .meta ['item' ]
90
86
category_code = item ['category_code' ]
91
87
is_page_last = response .xpath (u'.//div/a[@class="page-ch"]/text()="下一页"' ).extract ()[0 ].encode ('utf-8' )
@@ -105,9 +101,5 @@ def parse_two(self, response):
105
101
item ['file_path' ] = item ['dir_path' ] + '/' + file_name + '.jpg'
106
102
item ['image_url' ] = item ['image_url_dir' ] + '/' + file_name + '.jpg'
107
103
item ['image_html' ] = response .url
108
- print 'parse_one图片Id' + item ['image_id' ]
109
- print 'parse_one图片标题' + item ['image_title' ]
110
- print 'parse_one图片图片保存在数据库的目录' + item ['image_url_dir' ]
111
- print 'parse_one图片存储的目录' + item ['dir_path' ]
112
- print 'parse_one图片下载路径' + item ['image_down_url' ]
104
+
113
105
yield item
0 commit comments