0876デフォルトの名無しさん
2019/09/12(木) 07:44:02.36ID:W3DZId8kPython の3系を使えば?
Ruby では、
require "selenium-webdriver"
require "nokogiri"
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = Selenium::WebDriver.for :chrome, options: options
driver.navigate.to "http://www.example.com/"
doc = Nokogiri::HTML( driver.page_source )
# at_css で、該当する最初の1つだけを取得する
element = doc.at_css( "h1" )
puts element.content #=> Example Domain
driver.quit