Coder Social home page Coder Social logo

fang's Introduction

项目简介

本项目是基于React、Node.js、MongoDB 实现的一个JS全栈项目,项目用于查询上海各小区的房价信息。

项目中使用BaiduMap 用于以地图模式浏览小区,使用Koa作为Web后台框架,项目的编译构建使用的是webpack。

各小区的房价信息通过爬虫从链家网上抓取,然后存取到MongoDB中。Node.js 和 Python实现了两种爬虫。

截图

image

安装及运行

  1. 环境准备:Node.js、MongoDB、Python(可选)。
  2. 进入项目根路径。
  3. 执行 npm run build 安装项目依赖。
  4. 执行 npm run dev , 启动项目。
  5. 浏览器访问http://localhost:8080
  6. 此时网页中是没有小区数据的,需要通过爬虫抓取小区房价信息。 提供了两种爬虫实现: (1) 访问http://localhost:8080/crawler , 触发Node.js实现的爬虫。注意,虽然这个接口会立即返回,但抓取数据的过程实际上是异步的,可以通过控制台的日志观察当前的数据抓取情况。 (2) 在项目根路径下,执行python crawler.py , 触发Python实现的爬虫。

关于爬虫的注意事项:链家网对于接口的调用是有频率和次数限制的,虽然在程序中加了延迟时间用来降低访问链家网接口的频率, 但实际测试下来,仍然无法抓取所有数据。想要抓取更多的数据,可增加程序的延迟时间,或者分多次抓取数据。

声明

爬虫抓取的数据来源于链家网,仅作为学习使用。

参考项目: https://github.com/vvsuperman/fkEstate

License

MIT

fang's People

Contributors

xuchaobei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.