LoginSignup
9
9

More than 5 years have passed since last update.

Ubuntu + Ruby + selenium-webdriver で Google Chrome をエミュレート

Last updated at Posted at 2014-12-15

インストール

Google Chrome、chromedriver、Xvfbのインストール

http://qiita.com/pandora2000/items/ca1654cc40d07c09b78d に従ってください

Gems

gem install headless
gem install selenium-webdriver

使い方

require "selenium-webdriver"
require 'headless'

headless = Headless.new
headless.start
driver = Selenium::WebDriver.for :chrome
driver.navigate.to "http://google.com"

element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit

puts driver.title

driver.quit
headless.destroy
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9