This is a very simple skraping api. It uses nokogiri and it's intended to be very easy to use. Keep in mind it's still at a very early stage in development, and lots of changes might happen.
Add this line to your application's Gemfile:
gem 'skrape', git: 'https://github.com/Draiken/skrape.git'
And then execute:
$ bundle
You can easily define your scrapers and use them with Skrape.define
scraper = Skrape.define do
sel "h1", :title
sel "ul > li", :items do
sel ".name", :name
end
end
scraper.scrape(html)
# the return will be something like
{
title: "Title",
items: [
{name: "Item 1"},
{name: "Item 2"}
]
}
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request