[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8074":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":15,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},8074,"ferrum","rubycdp\u002Fferrum","rubycdp","Headless Chrome Ruby API","https:\u002F\u002Fferrum.rubycdp.com",null,"Ruby",2030,164,24,26,0,1,28.65,"MIT License",false,"main",[23,24,25,26,27,28,29],"automation","chrome","chromium","developer-tools","headless","headless-chrome","web","2026-06-12 02:01:48","# Ferrum - high-level API to control Chrome in Ruby\n\n## [Documentation](https:\u002F\u002Fdocs.rubycdp.com\u002Fdocs\u002Fferrum\u002Fintroduction)\n\n\u003Cimg align=\"right\"\n     width=\"320\" height=\"241\"\n     alt=\"Ferrum logo\"\n     src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Frubycdp\u002Fferrum\u002Fmain\u002Flogo.svg?sanitize=true\">\n\nIt is Ruby clean and high-level API to Chrome. Runs headless by default, but you\ncan configure it to run in a headful mode. All you need is Ruby and [Chrome](https:\u002F\u002Fwww.google.com\u002Fchrome\u002F) or [Chromium](https:\u002F\u002Fwww.chromium.org\u002F).\nFerrum connects to the browser by [CDP protocol](https:\u002F\u002Fchromedevtools.github.io\u002Fdevtools-protocol\u002F) and  there's _no_\nSelenium\u002FWebDriver\u002FChromeDriver dependency. The emphasis was made on a raw CDP\nprotocol because Chrome allows you to do so many things that are barely\nsupported by WebDriver because it should have consistent design with other\nbrowsers.\n\n* [Cuprite](https:\u002F\u002Fgithub.com\u002Frubycdp\u002Fcuprite) is a pure Ruby driver for[Capybara](https:\u002F\u002Fgithub.com\u002Fteamcapybara\u002Fcapybara) based on Ferrum.\n* [Vessel](https:\u002F\u002Fgithub.com\u002Frubycdp\u002Fvessel) high-level web crawling framework based on Ferrum and Mechanize.\n\n## Install\n\nThere's no official Chrome or Chromium package for Linux don't install it this\nway because it's either outdated or unofficial, both are bad. Download it from\nofficial source for [Chrome](https:\u002F\u002Fwww.google.com\u002Fchrome\u002F) or [Chromium](https:\u002F\u002Fwww.chromium.org\u002Fgetting-involved\u002Fdownload-chromium).\nChrome binary should be in the `PATH` or `BROWSER_PATH` and you can pass it as an\noption to browser instance see `:browser_path` in\n[Customization](https:\u002F\u002Fdocs.rubycdp.com\u002Fdocs\u002Fferrum\u002Fcustomization).\n\nAdd this to your `Gemfile` and run `bundle install`.\n\n``` ruby\ngem \"ferrum\"\n```\n\n## Quick Start\n\nNavigate to a website and save a screenshot:\n\n```ruby\nbrowser = Ferrum::Browser.new\nbrowser.go_to(\"https:\u002F\u002Fgoogle.com\")\nbrowser.screenshot(path: \"google.png\")\nbrowser.quit\n```\n\nWhen you work with browser instance Ferrum creates and maintains a default page for you, in fact all the methods above\nare sent to the `page` instance that is created in the `default_context` of the `browser` instance. You can interact\nwith a page created manually and this is preferred:\n\n```ruby\nbrowser = Ferrum::Browser.new\npage = browser.create_page\npage.go_to(\"https:\u002F\u002Fgoogle.com\")\ninput = page.at_xpath(\"\u002F\u002Finput[@name='q']\")\ninput.focus.type(\"Ruby headless driver for Chrome\", :Enter)\npage.at_css(\"a > h3\").text # => \"rubycdp\u002Fferrum: Ruby Chrome\u002FChromium driver - GitHub\"\nbrowser.quit\n```\n\nEvaluate some JavaScript and get full width\u002Fheight:\n\n```ruby\nbrowser = Ferrum::Browser.new\npage = browser.create_page\npage.go_to(\"https:\u002F\u002Fwww.google.com\u002Fsearch?q=Ruby+headless+driver+for+Capybara\")\nwidth, height = page.evaluate \u003C\u003C~JS\n  [document.documentElement.offsetWidth,\n   document.documentElement.offsetHeight]\nJS\n# => [1024, 1931]\nbrowser.quit\n```\n\nDo any mouse movements you like:\n\n```ruby\n# Trace a 100x100 square\nbrowser = Ferrum::Browser.new\npage = browser.create_page\npage.go_to(\"https:\u002F\u002Fgoogle.com\")\npage.mouse\n  .move(x: 0, y: 0)\n  .down\n  .move(x: 0, y: 100)\n  .move(x: 100, y: 100)\n  .move(x: 100, y: 0)\n  .move(x: 0, y: 0)\n  .up\n\nbrowser.quit\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies.\n\nThen, run `bundle exec rake test` to run the tests. You can also run `bin\u002Fconsole` for an interactive prompt that will\nallow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the\nversion number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,\npush git commits and the created tag, and push the `.gem` file to [rubygems.org](https:\u002F\u002Frubygems.org).\n\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https:\u002F\u002Fgithub.com\u002Frubycdp\u002Fferrum).\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT).\n","Ferrum 是一个用于控制 Chrome 的 Ruby 高级 API，支持无头模式运行。它基于 CDP 协议直接与 Chrome 交互，无需依赖 Selenium\u002FWebDriver\u002FChromeDriver，从而提供了更强大且灵活的功能，如页面操作、JavaScript 执行和鼠标移动等。项目特别适用于需要自动化测试、网页抓取或任何涉及 Chrome 自动化的场景。此外，Ferrum 还为 Capybara 提供了纯 Ruby 的驱动 Cuprite，并支撑了一个高级的 Web 爬虫框架 Vessel。通过简单的 Gem 安装即可开始使用，适合于对性能和灵活性有较高要求的技术团队。",2,"2026-06-11 03:15:55","top_language"]