Skip to content

wombat

1,308 2 24 MIT
3.0.0 (23 Aug 2022) Dec 27 2011 1.6 thousand (month)

Wombat is a Ruby gem that makes it easy to scrape websites and extract structured data from HTML pages. It is built on top of Nokogiri, a popular Ruby gem for parsing and searching HTML and XML documents, and it provides a simple and intuitive API for defining and running web scraping operations.

One of the main features of Wombat is its ability to extract structured data from HTML pages using a simple, CSS-like syntax. It allows you to define a set of rules for extracting data from a page, and then automatically applies those rules to the page's HTML to extract the desired data. This makes it easy to extract data from even complex and dynamic pages, without having to write a lot of custom code.

In addition to its data extraction capabilities, Wombat also provides a variety of other features that can simplify the web scraping process. It can automatically follow links and scrape multiple pages, it can handle pagination and AJAX requests, and it can handle cookies and authentication. It also provides a built-in support for parallelism and queueing to speed up the scraping process.

Example Use


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
will result in:
{
  "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"
  }
}

Alternatives / Similar


800 0.7.1 (7 months ago) Jul 25 2009 compare

Other Languages

22,947 v2.1.0 (4 years ago) May 14 2018 compare
7,566 v1.3.4 (4 years ago) Feb 15 2020 compare
2,580 2024-09-06 (4 days ago) Jun 06 2019 compare
655 2024-08-30 (11 days ago) Feb 09 2017 compare
52,313 2.11.2 (3 months ago) Jul 26 2019 compare
1,490 1.0.4 (2 years ago) Nov 22 2014 compare
2,927 1.4.3 (11 months ago) Sep 04 2013 compare
5,696 v0.18.0 (1 year, 5 months ago) Aug 06 2019 compare
2,029 (3 years ago) Nov 20 2016 compare
6,683 2.0.2 (a month ago) Sep 10 2012 compare
6,161 1.1.14 (2 years ago) Jul 26 2019 compare
2,928 v2.1.1 (9 months ago) Jul 17 2018 compare
3,103 1.5.0 (6 months ago) Sep 30 2018 compare
245 1.33.0 (6 months ago) Feb 05 2023 compare
3,306 0.9.13 (1 year, 1 month ago) Jul 04 2017 compare
1,744 0.8.5 (2 years ago) Oct 17 2018 compare
10,890 1.1.9 (5 years ago) Aug 24 2018 compare
1,347 v3.2.0 (5 months ago) Dec 27 2021 compare
156 2.2.4 (3 years ago) Dec 22 2019 compare
517 3.0.0 (5 months ago) May 04 2020 compare
420 0.1.3 (1 year, 1 month ago) Feb 20 2022 compare
1,328 v0.7.2 (9 months ago) Mar 16 2013 compare
205 1.0.0-beta8.4 (1 year, 2 months ago) Apr 18 2019 compare
322 v2.0.0-beta.2 (15 days ago) Apr 18 2022 compare
Was this page helpful?