Git Product home page Git Product logo

rururu's Introduction

My Pet Project. rururu (るるる) is a simple scraping tool. 「るるる」はシンプルなスクレイピングツールです。

Features

  • Get values with URLs and Elements. URLと検索要素(XPathなど)を指定して文字列を抽出
  • CSV output. 抽出結果はCSV形式で出力
  • Sleep per one scraping for prevent being consider an attack. スクレイピング中に攻撃とみなされないように1スクレイピング毎にスリープ時間を定義

Technologies

Frontend Layer

Application Layer

Development

  • App file is only One-File also including images on Sinatra. Sinatraを使って1ファイルのみで開発

Install & Run

Install

  1. Install Ruby
  2. Download & Unarchive rururu(るるる) zip in GitHub
  3. $ cd [Unarchive rururu folder]
  4. $ gem install bundler:2.0.1
  5. $ gem update bundler
  6. $ bundle install --path vendor/bundle

Run

  1. $ cd [Unarchive rururu folder]
  2. $ bundle exec ruby app.rb
  3. Open http://localhost:4567/ in browser
  4. [Enjoy scraping!]
  5. If you want to stop it, control + C in Terminal

HowTo Run

1.Form

1行1URLで入力

例:Wikipediaの日本とタイ王国のページをスクレイピングする場合

https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC
https://ja.wikipedia.org/wiki/%E3%82%BF%E3%82%A4%E7%8E%8B%E5%9B%BD

Scraping Form

1行1要素/XPathで入力

例:首都と人口をXPathで取得する場合

//*[@id="infoboxCountry"]/dd[5]/table/tbody/tr[2]/td/a
//*[@id="infoboxCountry"]/dd[5]/table/tbody/tr[4]/td/dl/dd[3]/table/tbody/tr[1]/td/a[1]

XPathはChromeの検証ツールでかんたんに取得できます。取得方法は「Chrome XPath」で検索してみてください。

Result CSV

または、タグとクラス名で取得する場合、「[タグ名].[クラス名]」として指定できます。

dt.infoboxCountryNameJa

2.Result

  1. Copy & Paste result(textarea) values to textpad. スクレイピング結果をメモ帳などにコピペ
  2. Save as somename.csv. 適当な名前をつけてCSV形式で保存

rururu's People

Contributors

256hax avatar dependabot[bot] 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.