selenium-webdriver firefox
1. Install geckodriver
% brew install geckodriver Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae tfproviderlint ==> Updated Formulae Updated 46 formulae. ==> Updated Casks Updated 52 casks. ==> Deleted Casks globalmeet ==> Downloading https://ghcr.io/v2/homebrew/core/geckodriver/manifests/0.30.0 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/geckodriver/blobs/sha256:d490f9171f301363ee590ea705d1f111c8c90aa68bbfb70e8dcf093b6dbde424 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:d490f9171f301363ee590ea705d1f111c8c90aa68bbfb70e8dcf093b6dbde424?se=2021-11-14T23%3A15%3A00Z&sig=ablASFGKkTL%2FRGuKPXKF ######################################################################## 100.0% ==> Pouring geckodriver--0.30.0.catalina.bottle.tar.gz 🍺 /usr/local/Cellar/geckodriver/0.30.0: 6 files, 5.3MB ==> `brew cleanup` has not been run in the last 30 days, running now... Removing: /Users/cw/Library/Caches/Homebrew/openjdk--17... (180.2MB) Removing: /Users/cw/Library/Logs/Homebrew/maven... (64B) Removing: /Users/cw/Library/Logs/Homebrew/openjdk... (64B) Pruned 1 symbolic links from /usr/local
2. irb
require "selenium-webdriver" driver = Selenium::WebDriver.for :firefox driver.navigate.to "http://google.com" element = driver.find_element(name: 'q') element.send_keys "Hello WebDriver!" element.submit puts driver.title driver.quit
https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings
3. irb with docker
require 'webdrivers' require 'selenium-webdriver' caps = Selenium::WebDriver::Remote::Capabilities.chrome driver = Selenium::WebDriver.for(:remote, :url => "http://localhost:4444/wd/hub",:desired_capabilities => caps) driver.get('http://google.com') element = driver.find_element(name: 'q') element.send_keys "Hello WebDriver!" element.submit puts driver.title driver.close
https://www.selenium.dev/documentation/webdriver/http_proxies/
https://github.com/SeleniumHQ/docker-selenium
https://github.com/SeleniumHQ/docker-selenium