RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

[New Gem] Chromate: Effortless Browser Automation with Ruby and CDP 🚀

Hey Ruby devs! 👋

I’m excited to announce the first release of Chromate, a new Ruby gem that simplifies browser automation using the Chrome DevTools Protocol (CDP). If you’ve been looking for a lightweight alternative to Selenium or Playwright, Chromate might be what you need!

🌟 Key Features:
  • Headless Chrome Automation: Fast and efficient, perfect for scraping and testing.
  • Direct CDP Integration: Bypass browser extensions and control Chrome directly.
  • Virtual Mouse & Keyboard: Mimic real user behavior for undetectable interactions.
  • Easy Setup: Built with Ruby developers in mind—simple API and fast performance.
💡 Example Usage:

```ruby require ‘chromate’

browser = Chromate::Browser.new(headless: true) browser.start browser.navigate_to(‘https://example.com’)

search_input = browser.find_element(‘input[name=”q”]’) search_input.type(‘Ruby programming’) search_input.press_enter

first_result = browser.find_element(‘h3’) first_result.click

puts browser.find_element(‘body’).text[0..200] browser.stop ```

📦 Check It Out:

GitHub repo: Eth3rnit3/Chromate

Give it a try, star it if you like it, and let me know your feedback! Contributions are welcome! 💎✨

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in