{"id":43221193,"url":"https://github.com/vifreefly/rubium","last_synced_at":"2026-02-12T08:01:50.632Z","repository":{"id":56893132,"uuid":"161527625","full_name":"vifreefly/rubium","owner":"vifreefly","description":"Antidetect Headless Chrome Browser for Ruby Web Scraping and Automation","archived":false,"fork":false,"pushed_at":"2026-01-02T09:26:39.000Z","size":41,"stargazers_count":64,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-08T08:47:01.361Z","etag":null,"topics":["antidetect-browser","automation","capybara","chromium","crawler","headless","playwright","puppeteer","ruby","scraping","web-scraping"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vifreefly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-12T18:17:29.000Z","updated_at":"2026-01-02T09:26:42.000Z","dependencies_parsed_at":"2022-08-20T16:10:31.680Z","dependency_job_id":null,"html_url":"https://github.com/vifreefly/rubium","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vifreefly/rubium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vifreefly%2Frubium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vifreefly%2Frubium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vifreefly%2Frubium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vifreefly%2Frubium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vifreefly","download_url":"https://codeload.github.com/vifreefly/rubium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vifreefly%2Frubium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antidetect-browser","automation","capybara","chromium","crawler","headless","playwright","puppeteer","ruby","scraping","web-scraping"],"created_at":"2026-02-01T09:00:40.954Z","updated_at":"2026-02-12T08:01:50.624Z","avatar_url":"https://github.com/vifreefly.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Rubium\n\n## Description\n\nRubium is a lightweight Ruby API for headless antidetect Chrome browser automation. It provides essential web navigation methods in just 300 lines of code — no Selenium or heavy dependencies required. Use it as a simple alternative to Capybara/Puppeteer/Playwright for web scraping and browser automation tasks:\n\n```ruby\nrequire 'rubium'\n\nbrowser = Rubium::Browser.new\nbrowser.goto('https://github.com/vifreefly/rubium')\n\n# Get current page response as string:\nbrowser.body\n# Get current page response as Nokogiri object:\nbrowser.current_response\n\n# Click to the some element (css selector):\nbrowser.click('some selector')\n\n# Get current cookies:\nbrowser.cookies\n\n# Set cookies (Array of hashes):\nbrowser.set_cookies([\n  { name: 'some_cookie_name', value: 'some_cookie_value', domain: '.some-cookie-domain.com' },\n  { name: 'another_cookie_name', value: 'another_cookie_value', domain: '.another-cookie-domain.com' }\n])\n\n# Fill in some field:\nbrowser.fill_in('some field selector', 'Some text')\n\n# Tells if current response has provided css selector or not. You can\n# provide optional `wait:` argument (in seconds) to set the max wait time for the selector:\nbrowser.has_css?('some selector', wait: 1)\n\n# Tells if current response has provided text or not. You can\n# provide optional `wait:` argument (in seconds) to set the max wait time for the text:\nbrowser.has_text?('some text')\n\n# Evaluate some JS code on a new tab:\nbrowser.evaluate_on_new_document(File.read 'browser_inject.js')\n\n# Evaluate JS code expression:\nbrowser.execute_script('JS code string')\n\n# Access chrome_remote client (instance of ChromeRemote class) directly:\n# See more here: https://github.com/cavalle/chrome_remote#using-the-chromeremote-api\nbrowser.client\n\n# Close browser:\nbrowser.close\n\n# Restart browser:\nbrowser.restart!\n```\n\n**There are some options** which you can provide while creating browser instance:\n\n```ruby\nbrowser = Rubium::Browser.new(\n  debugging_port: 9222,                  # custom debugging port. Default is any available port.\n  headless: false,                       # Run browser in normal (not headless) mode. Default is headless.\n  window_size: [1600, 900],              # Custom window size. Default is unset.\n  user_agent: 'Some user agent',         # Custom user-agent.\n  proxy_server: 'http://1.1.1.1:8080',   # Set proxy.\n  extension_code: 'Some JS code string', # Inject custom JS code on each page. See above `evaluate_on_new_document`\n  cookies: [],                           # Set custom cookies, see above `set_cookies`\n  restart_after: 25,                     # Automatically restart browser after N processed requests\n  enable_logger: true,                   # Enable logger to log info about processing requests\n  max_timeout: 30,                       # How long to wait (in seconds) until page will be fully loaded. Default 60 sec.\n  urls_blacklist: ['*some-domain.com*'], # Skip all requests which match provided patterns (wildcard allowed).\n  disable_images: true                   # Do not download images.\n)\n```\n\nNote that for options `user_agent` and `proxy_server` you can provide `lambda` object instead of string:\n\n```ruby\nUSER_AGENTS = ['Safari', 'Mozilla', 'IE', 'Chrome']\nPROXIES = ['http://1.1.1.1:8080', 'http://2.2.2.2:8080', 'http://3.3.3.3:8080']\n\nbrowser = Rubium::Browser.new(\n  user_agent:   -\u003e { USER_AGENTS.sample },\n  proxy_server: -\u003e { PROXIES.sample },\n  restart_after: 25\n)\n```\n\n\u003e What for: Chrome doesn't provide an API to change proxies on the fly (after browser has been started). It is possible to set proxy while starting Chrome instance by providing CLI argument only. On the other hand, Rubium allows you to automatically restart browser (`restart_after` option) after N processed requests. On each restart, if options `user_agent` and/or `proxy_server` has lambda format, then lambda will be called to fetch fresh value. Thus it's possible to rotate proxies/user-agents without any much effort.\n\n\n**You can provide custom Chrome binary** path this way:\n\n```ruby\nRubium.configure do |config|\n  config.chrome_path = '/path/to/chrome/binary'\nend\n```\n\nCommon Chrome path example for MacOS:\n\n```ruby\nRubium.configure do |config|\n  config.chrome_path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'\nend\n```\n\n\n## Installation\nRubium tested with `3.1.0` Ruby version and up.\n\n## Contribution\nSure, feel free to fork and add new functionality.\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvifreefly%2Frubium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvifreefly%2Frubium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvifreefly%2Frubium/lists"}