GithubHelp home page GithubHelp logo

scrapyprojects's Introduction

ScrapyProjects

Scrapy学习笔记

Pycharm中debug Scrapy

创建main.py

    from scrapy.cmdline import execute

    import sys
    import os

    # print(os.path.dirname(os.path.abspath(__file__)))
    # F:\ScrapyProjects\qiantuSpider\qiantuSpider

    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    execute(["scrapy", "crawl", "qtspider"])

右键, debug main.py执行

Spider架构

  1. Scrapy Engine 引擎
  2. Scheduler 调度器
  3. Downloader 下载器
  4. Spider 爬虫
  5. Item Pipeline 管道
  6. Downloader MiddleWares 下载中间件
  7. Spider MiddleWares Sipder中间件

制作Scrapy爬虫4步走

  1. 新建项目 (scrapy startproject xxx): 新建一个新的爬虫项目
  2. 明确目标 (编写items.py, pipelines.py和setting.py): 明确你想要抓取的目标和进一步处理数据
  3. 制作爬虫 (spiders/xxspider.py): 制作爬虫开始爬取网站
  4. 存储内容 (pipeline.py): 设计管道存储爬取内容

v1. 1.制作福田表格 2.单链接爬取

v2. 1.多连接一起爬取 2.自动切换表格导入

scrapyprojects's People

Contributors

alexhong33 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.