Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
Ruby web scraping libraries fetch web pages and extract structured data from their HTML. Pages that build their content with JavaScript need a controlled browser to render them before extraction. These libraries let data pipelines and AI agents collect prices, listings, and articles from sites without an API.
Popularity
Nokogiri has the most monthly downloads in this comparison, at 1304424215, a count that covers all its HTML and XML parsing.
def parse(data)
case type = extraction_type
when "xml"
doc = Nokogiri::XML(data)
# ignore xmlns, useful when parsing atom feeds doc.remove_namespaces! unless use_namespaces?
doc
when "json"
JSON.parse(data)
when "html"
Nokogiri::HTML(data)
when "text"
data
else
raise "Unknown extraction type: #{type}"
end
end
Watir
Automates browser clicks, form input, and text checks from Ruby.
Downloads / mo
43086188
Stars
1.5K
Last release
7.3.0
License
MIT
Strengths
Waits before acting on elements.Element actions wait for the element to become ready.
Offers readable attribute selectors.Find elements by labels, text, and other meaningful attributes.
Limitations
CSS selectors must stand alone.Use CSS or XPath without adding other locator keys.
Reads need their own waits.Use wait_until before reading content that arrives asynchronously.
def element_with_focus
element = browser.execute_script("return document.activeElement")
type = element.type.to_sym if element.tag_name.to_sym == :input
cls = ::PageObject::Elements.element_class_for(element.tag_name, type)
cls.new(element)
end
Mechanize
Automates website navigation with cookies, redirects, and form submission.
Downloads / mo
42799551
Stars
4.4K
Last release
2.14.2
License
MIT
Strengths
Preserves cookies across navigation.Follow links and redirects while retaining the website session.
Fills and submits HTML forms.Populate form fields before submitting through the session.
Limitations
JavaScript pages need another tool.Use a browser when required content is generated by JavaScript.
require "playwright"
Playwright.create(playwright_cli_executable_path: "./node_modules/.bin/playwright-core") do |playwright|
playwright.chromium.launch do |browser|
page = browser.new_page
page.goto("https://example.com/")
puts page.title
end
end
def crawl
logger.info "Crawling #{wraith.base_domain}"
Anemone.crawl(wraith.base_domain) do |anemone|
anemone.skip_links_like(/\.(#{EXT.join('|')})$/)
# Add user specified skips anemone.skip_links_like(wraith.spider_skips)
anemone.on_every_page do |page|
logger.info " #{page.url.path}"
add_path(page.url.path)
end
end
logger.info "Crawl complete."
write_file
end
Kimurai
Provides a web scraping framework in Ruby based on Capybara and Nokogiri.
def parse(response, url:, data: {})
Parallel.each(response.css('a.category-list-item-link')) do |framework|
request_to :parse_framework, url: URI.join('https://developer.apple.com/', framework[:href]).to_s
rescue StandardError => e
puts "There is failed request (#{e.inspect}), skipping it..."
end
end
FAQ
Nokogiri suits parsing fetched HTML with CSS selectors or XPath. Mechanize suits sites that need cookies, redirects, and form submission. Ferrum suits pages that JavaScript renders in Chrome.
Nokogiri parses and queries HTML and XML documents from Ruby with CSS selectors or XPath.
Watir automates browser clicks, form input, and text checks from Ruby. Element actions wait for each element to become ready.
Ferrum controls Chrome or Chromium directly through the DevTools Protocol, without ChromeDriver.
No. Content generated by JavaScript needs a browser such as Ferrum or Watir.
For coding agents
Found your web scraping library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.