Ruby1.8.7 安装和使用selenium
require 'selenium-webdriver'ie = Selenium::WebDriver.for :ieie.get 'www.baidu.com'puts ie.current_urlinputElement=ie.find_element(:name, 'wd') # p inputElement.textinputElement.send_keys "123"inputElement=ie.find_element(:id, 'su').submit()ie.navigate.back
如果遇到如下异常,对着IE按Ctrl+0
引用 Unexpected error launching Internet Explorer. Browser
zoom level was set to 125%. It should be set to 100% (Selenium::WebDriver::Error::NoSuchDriverError)
4. 更多Selenium api文档
http://docs.seleniumhq.org/docs/03_webdriver.jsp#selenium-webdriver-api-commands-and-operations