Python uses scrapy crawler frame to crawl pictures and save local (sister map)

Source: Internet
Author: User

You can clone all the source code on GitHub.

Github:https://github.com/williamzxl/scrapy_crawlmeizitu

Scrapy Official Document: http://scrapy-chs.readthedocs.io/zh_CN/latest/index.html

Basically, follow the documentation process to go through the basic will be used.

STEP1:

Before you begin a crawl, you must create a new Scrapy project. Enter the directory where you want to store the code, and run the following command:

Startproject Crawlmeizitu

The command creates a directory that contains the following content tutorial :

 crawlmeizitu/scrapy. CFG crawlmeizitu   / __init__. PY items. PY pipelines. PY settings. PY 
middlewares.py spiders/__init__.py CD crawlmeizitu
/span>
Meizituhttp://www.meizitu.com/a/list_1_1.html

The command creates a directory that contains the following content tutorial :

crawlmeizitu/scrapy. CFG crawlmeizitu/
__init__< Span class= "O". py items. PY pipelines. PY settings. PY
middlewares.py spiders/
meizitu.py __init__.py
Our main editors are as shown in the arrows:


Main.py was later added, adding two orders, mainly for the convenience of operation.

STEP2: Edit settings as shown in


STEP3: Edit Items.


STEP4: Edit Pipelines


STEP5: Edit the main program of the Meizitu.

Python uses scrapy crawler frame to crawl pictures and save local (sister map)

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.