首页新闻找找看学习计划

scrapy get_media_requests没有执行,怎么回事,有谁知道吗

0
[待解决问题]

from scrapy.pipelines.images import ImagesPipeline
import scrapy
class ImgspiderdemoPipeline(ImagesPipeline):

def get_media_requests(self, item, info):
    print(990)
    lists=len(item["image_urls"])
    for index in lists:
        url=item["image_urls"][index]
        name=item["imagename"][index]
        yield scrapy.Request(url=url,meta={"name":name})

def file_path(self, request, response=None, info=None):
    print(response.meta["name"])
    return response.meta["name"]+".jpg"


def process_item(self, item, spider):
    print(item["imagename"][0])
    return item

ITEM_PIPELINES = {
'imgspiderdemo.pipelines.ImgspiderdemoPipeline': 800,

}
重写了插件,没报错但好像没效果没有执行,图片没下载谁知道怎么回事

doctor_jin的主页 doctor_jin | 菜鸟二级 | 园豆:206
提问于:2019-02-11 17:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册