Lightweight Ruby web crawler/scraper with an elegant DSL which extracts structured data from pages. https://felipecsl.github.io/wombat/
Find a file
2026-04-07 09:22:13 -07:00
.github chore: Update rack and json dependencies 2026-04-07 09:19:14 -07:00
examples Tabs -> spaces 2015-07-15 00:57:22 -07:00
fixtures/vcr_cassettes Bump dependencies due to Nokogiri CVE-2019-5477 (#83) 2019-09-02 21:19:59 -07:00
lib Bump dependencies due to Nokogiri CVE-2019-5477 (#83) 2019-09-02 21:19:59 -07:00
spec chore: Add CI workflow, bump dependencies and fix tests (#97) 2022-08-23 10:05:18 -03:00
.document Initial commit to event-crawler. 2011-11-13 20:59:58 -08:00
.gitignore Fix bug on malformed selectors 2012-06-24 20:10:15 -07:00
.rspec Adding latest tests and implementation progress 2011-12-26 16:53:50 -02:00
.ruby-version project dependencies bump, upgrade to ruby v3 2025-11-26 21:43:55 -03:00
CHANGELOG.md Update changelog 2022-08-23 10:09:53 -03:00
Gemfile mechanize dep update 2025-11-26 21:48:20 -03:00
Gemfile.lock chore: Update rack and json dependencies 2026-04-07 09:19:14 -07:00
Guardfile Adding new files 2011-11-16 01:22:09 -05:00
LICENSE.txt Initial commit to event-crawler. 2011-11-13 20:59:58 -08:00
Rakefile project dependencies bump, upgrade to ruby v3 2025-11-26 21:43:55 -03:00
README.md remove broken badges 2022-08-23 10:11:20 -03:00
VERSION Version bump to 3.3.0 2026-04-07 09:22:01 -07:00
wombat.gemspec Regenerate gemspec for version 3.3.0 2026-04-07 09:22:13 -07:00

Wombat

Gem Version Code Climate Coverage Status FOSSA Status

Web scraper with an elegant DSL that parses structured data from web pages.

Usage:

gem install wombat

Scraping a page:

The simplest way to use Wombat is by calling Wombat.crawl and passing it a block:

require 'wombat'

Wombat.crawl do
  base_url "https://www.github.com"
  path "/"

  headline xpath: "//h1"
  subheading css: "p.alt-lead"

  what_is({ css: ".one-fourth h4" }, :list)

  links do
    explore xpath: '/html/body/header/div/div/nav[1]/a[4]' do |e|
      e.gsub(/Explore/, "Love")
    end

    features css: '.nav-item-opensource'
    business css: '.nav-item-business'
  end
end
The code above is gonna return the following hash:
{
  "headline"=>"How people build software",
  "subheading"=>"Millions of developers use GitHub to build personal projects, support their businesses, and work together on open source technologies.",
  "what_is"=>[
    "For everything you build",
    "A better way to work",
    "Millions of projects",
    "One platform, from start to finish"
  ],
  "links"=>{
    "explore"=>"Love",
    "features"=>"Open source",
    "business"=>"Business"
  }
}

Wiki

API Documentation

Changelog

Contributing to Wombat

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Contributors

Copyright (c) 2019 Felipe Lima. See LICENSE.txt for further details.

License

FOSSA Status