rubycdp / ferrum
git clone https://github.com/rubycdp/ferrum.git
v0.19.1 · 4d ago
🔥 on GitHub Trending today
Headless Chrome Ruby API
+0
stars, 24h · #668
—
stars, 7 days
—
stars, 30 days
2.1k
★ total
176
forks · 7 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageRuby
LicenseMIT
Created2019-07-23 (7y ago)
Last pushtoday
Watchers23
OwnerOrganization
Seen on GitHub Trending
- 2026-10-20 — #16 daily in ruby
GitHub topics
Links
- GitHub: github.com/rubycdp/ferrum
- Homepage: https://ferrum.rubycdp.com
- Releases · Issues · Hacker News mentions
README excerpt
# Ferrum - high-level API to control Chrome in Ruby ## Documentation It is Ruby clean and high-level API to Chrome. Runs headless by default, but you can configure it to run in a headful mode. All you need is Ruby and Chrome or Chromium. Ferrum connects to the browser by CDP protocol and there's _no_ Selenium/WebDriver/ChromeDriver dependency. The emphasis was made on a raw CDP protocol because Chrome allows you to do so many things that are barely supported by WebDriver because it should have consistent design with other browsers. * Cuprite is a pure Ruby driver for Capybara based on Ferrum. * Vessel high-level web crawling framework based on Ferrum and Mechanize. ## Install There's no official Chrome or Chromium package for Linux don't install it this way because it's either outdated or unofficial, both are bad. Download it from official source for Chrome or Chromium. Chrome binary should be in the `PATH` or `BROWSER_PATH` and you can pass it as an option to browser instance see `:browser_path` in Customization. Add this to your `Gemfile` and run `bundle install`. [code] Or skip installing Chrome and run it in a container with our images, see Docker: [code] [code] ## Quick Start Navigate to a website and save a screenshot: [code] When you work with browser instance Ferrum creates and maintains a default page for you, in fact all the methods above are sent to the `page` instance that is created in the `default_context` of the `browser` instance. You can interact with a page created manually and this is preferred: [code] Evaluate some JavaScript and get full width/height: [code] Do any mouse movements you like: [code] ## Development After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to rubygems.org. ## Contributing Bug reports and pull requests are welcome on GitHub. ## License The gem is available as open source under the terms of the MIT License.