GithubHelp home page GithubHelp logo

ezparser's Introduction

RailsFun 2016/9/7 爬蟲學習筆記

當天meetup筆記,感謝9/7當天三位講者的分享。

先前完全沒碰過爬蟲,會的Ruby也只有rails初學者堪用的程度,當天完全跟不上進度。

以下是我為了學習爬蟲,依序臨摹的範例,程式碼在examples,筆記在wiki

  1. Nokogiri 教學、簡介 | 艾瑞克王

  2. 爬蟲系列文 - Ruby爬蟲初探 « Carlos' notes

  3. 第十一篇 - 第一次自幹爬蟲就上手 - 使用 Ruby (Yukai Huang)

  4. 用 Ruby 做網頁爬蟲

  5. Steven教的最初範例:爬ezprice

GitHub的wiki有教學,一樣也有部落格版

你可以從這專案得到

這學習筆記完整記錄,我學習爬蟲過程中遇到所有問題與掙扎

讓我自己教會自己

  • 用Nokogiri爬蟲的基本語法,從最初學習使用xpath,到現在使用css
  • 從把網址存到本地端,使用File.read讀,進步到使用open-uri讀網址,到現在使用rest-client
  • 學會如何使用Pry來設中斷點debug
  • 體會臨摹帖子時,只學最少必要的知識量是什麼感覺。

這些之中,最有價值的應該是學會用Pry吧。

  1. 我學會查Ruby Core時先看Example code,然後把這程式碼用到Pry裡去。
  • 這樣的好處是「我先看到程式執行的結果,腦中已經有了畫面,再去看文字的解釋,會讓我學習時更快速理解」
  1. 透過binding.pry if ....給一個判斷式來判斷程式哪裡出錯

ToDo

  • 爬大同大學選課系統
  • 原本是打算把Steven的教材:爬大同大學的課表這個範例臨摹完,串好rails才上GitHub。
  • 沒想到2016/9/19爬個三次後,大同選課系統的網站就連不上去了...。ex6是未完成的屍體,只有等大同的網站弄好後,再來半夜人少時練爬蟲了

ezparser's People

Contributors

nickwarm avatar

Stargazers

bscd avatar Fly Chang avatar Nic avatar

Watchers

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