Giter Site home page Giter Site logo

webspider's Introduction

輕輕鬆鬆用 Node.js 寫網路爬蟲

目錄底下有兩個專案 , 介紹如下

Spider

Introduce

  • 用 nodejs 寫出一個爬蟲 , 幫我們查尋機票價錢
  • 目標: 香草航空訂票頁面
  • 小技巧 :用 chrome 開發工具研究瀏覽器與 server 的 http request &response , 以及用 postman 測試 http request

Dependencies

Third-party
Cheerio : 與 jQuery 相似 , 提供 DOM 操作方法 , 方便我們解析抓到的頁面

Built in
Https : 使用 https.request 像 server 發出請求取得頁面
Querystring :使用 querystring.stringify 將我們的表單資料 json 包裝成 server可解讀的形式
File System : 使用 fs.writeFile 將 server 端回傳的頁面存在本地

Basic Install

cd spider
npm install

Run

node demo.js



Site

alt tag

因為計畫去日本旅遊 , 但去每一個網站查詢票價太麻煩了 , 所以把高雄到日本廉航網站都爬了一遍 , 然後做出了這個票價查詢網站

Introduce

Basic Install

cd site
npm install
bower install

Run

npm start

Go to http://localhost:3030/ , Enjoy !!

Other

如果想一起讓這個專案更強大或者發現任何問題 , 歡迎 pull request 或者聯繫我

webspider's People

Contributors

chungchiehlun avatar

Watchers

James Cloos 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.