Redis and Scrapy

Source: Internet
Author: User

<title>Redis and Scrapy</title> Redis and Scrapy

Redis is a open source, BSD licensed, Advanced Key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, Bitma PS and Hyperloglogs. --redis Home Page

1. Installing the Scrapy-redis module
    • Pip Install Scrapy-redis
    • Easy_install Scrapy-redis
2. Installing and Running Redis
    • Http://redis.io/download
    • To run Redis:redis-server redis.conf
    • Empty the cache:redis-cli flushdb
3. Scrapy Configuring Redis
    • settings.py Configuring Redis
"scrapy_redis.scheduler.Scheduler"
SCHEDULER_PERSIST =True
‘scrapy_redis.queue.SpiderPriorityQueue‘
None
‘127.0.0.1‘#REDIS服务器的ip
6379#REDIS服务器端口
    • Spider calls Redis
fromimport RedisSpider
class xxx(RedisSpider):
..................
‘username:password‘
..................

Redis and Scrapy

Related Article

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.