yasf
Yet Another Scraper Framework
Installation
Add this line to your application's Gemfile:
gem 'yasf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yasf
Usage
row_scraper = Yasf.define do
scrape "h1.title", :title => :text
scrape "a.brand", :brand => :text, :brand_link => :href
result :title, :brand, :brand_link
end
scraper = Yasf.define do
scrape "table.companies tr.company", :'rows[]' => row_scraper
result :rows
end
And using the scraper:
url = "http://local.domain"
results = scraper.extract_from(url)
result = results.first
puts result.title
Contributing
- 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