Code Monkey home page Code Monkey logo

sfspider's Introduction

SFspider

##整体说明 本工程是爬虫框架, 爬取SF网站的问题以及应答,并插入MySQL db中

##工程文件

  • url_manager.py URL 管理器
  • html_downloader.py 下载器
  • html_parser.py 解析器
  • html_outputer.py 输出器
  • init.sql 初始化SQL

##配置参数

  • 并发线程数 concurrent_thread_amount = 10
  • 爬取下载延迟 download_delay = 1
  • 爬取前几页 page_num = 10
  • 定义函数对照表,主要解决解析函数过多,类型过多的问题 self.function_table = {...}

使用

  • 执行init.sql 建表
  • 配置config.py的start_urls
  • 修改spider_main.py的“放入初始url”部分
  • 编辑self.function_table映射表
  • 修改解析函数逻辑解析

TODO

  • redis使用: 使用redis管理url,并实现分布式爬取

sfspider's People

Contributors

yyt030 avatar

Stargazers

诸葛蛋 avatar  avatar

Watchers

 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.