Does scrapy have its own method of downloading files when downloading files? Download??

excuse me, does the scrapy download file have its own download? Or write a new download yourself?

Jun.24,2021

Yes, scrapy comes with three Pipeline of file,image,media
take file download as an example:
1. Import FilesPipeline: from scrapy.pipelines.files import FilesPipeline
2 in the pipelines module Enable: ITEM_PIPELINE= {'scrapy.pipelines.files.FilesPipeline':1}
3 in the configuration file In the configuration file configuration download directory FILES_STORE='/user/somepath'
4. Define two key fields in the items module:

class ExamplesItem(scrapy.Item):
    file_urls=scrapy.Field()
    files=scrapy.Field()

5. In siper, you only need to add the URL to be downloaded to the Item instance:

    def parse(self,response):
        download_url=response.css('a::attr(href)').extract_first()-sharpurl
        item=ExamplesItem()
        item['file_urls']=[download_url]
        yield item

6. Just start sipder.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ba5f-40839.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ba5f-40839.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?