Giter Club home page Giter Club logo

gowhere-crawler's Introduction

GoWhere-Crawler

一个基于Node.js和puppteer的爬虫小项目,用于给GoWhere项目去哪儿网移动端页面爬取数据(图片、价格、评论等)

使用

//  复制到本地
git clone git@github.com:Jacleklm/Image-Crawler.git

//  定位到该文件夹
cd GoWhere-Crawler

//  安装依赖
npm install puppeteer --save

//  定位到该文件夹
cd src
cd Crawler

// 运行该文件即可对去哪儿网的数据进行爬取,生成的JSON文件放在 /static/mock 中
node Crawler.js

存在的问题

  • 代码有些不优雅,先拿到爬虫结果吧,以后再来思考怎么改善;
  • 在爬取详情页面的时候由于要挪动到图片的位置触发图片加载,用element.scrollIntoView(),但是由于各页面实际情况可能有点不同,有时候会出bug,暂时还无法解决。如果bug出现太频繁,建议先注释掉Crawler.js中的detailCrawler(),拿到index.json和city.json后再单独运行detailCrawler()拿到detail.json。

gowhere-crawler's People

Contributors

jacleklm avatar

Stargazers

 avatar  avatar

Watchers

 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.