Python3 scrapy Crawler (Volume 13th: Scrapy+scrapy_redis+scrapyd Build a distributed crawler configuration)

Source: Internet
Author: User

Before, our crawler was a stand-alone crawl, and it was a single-machine maintenance request queue,

Take a look at the flowchart of a single machine:

A host control a queue, now I want to put it in a multi-machine execution, will produce a thing is to do the repeated crawl, meaningless, so the first difficulty of the distributed crawler out, share the request queue, look at the architecture:

Three hosts are controlled by a queue, which means that a host is also required to control the queue, and we typically use Redis to control the queue to form the following distributed architecture

Slave fetching, the storage host is responsible for controlling the queue

Scrapy_redis This plugin solves the problem that scrapy cannot do a distributed crawl

Its internal connection.py as a redis that connects master

Dupefilter. PY is used as a de-weight, add fingerprint, and judging function, now the entire framework understands, now it's time to do

Python3 scrapy Crawler (Volume 13th: Scrapy+scrapy_redis+scrapyd Build a distributed crawler configuration)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.