Home > other >  Scrapy get_media_requests no execution, what's the matter, who knows
Scrapy get_media_requests no execution, what's the matter, who knows

Time:04-20


The from scrapy. Pipelines. Images import ImagesPipeline
The import scrapy
The class ImgspiderdemoPipeline (ImagesPipeline) :
Def get_media_requests (self, item info) :
Print (990)
Lists=len (item [" image_urls "])
For the index lists in:
Url=item [" image_urls "] [index]
Name=item [" imagename "] [index]
Yield scrapy. Request (url=url, meta={" name ": name})

Def file_path (self, the request and the response=None, info=None) :
Print (response. Meta/" name ")
Return the response. The meta/" name "+". JPG "


Def process_item (self, item, spiders) :
Print (item [" imagename "] [0])
Return the item
ITEM_PIPELINES={
'imgspiderdemo. Pipelines. ImgspiderdemoPipeline: 800,
}
Rewrite the plug-in, not an error but seems no effect no execution, image didn't download
who know what is going on

CodePudding user response:

To ask solved

CodePudding user response:

Solve the building Lord, I this also does not perform, headache is dead
  • Related