require "rubygems"
require "selenium"
require "selenium-webdriver"
require "selenium-proxy"
client = Selenium::WebDriver::Remote::Http::Default.new
client.proxy = Selenium::Proxy.new(:http => "proxify.com:8080")
driver = Selenium::WebDriver.for(:remote, :http_client => client)
获得以下错误:
proxy-test.rb:7:在`':未初始化的常量Selenium :: Proxy(NameError)
注意:我已经安装了
gem install selenium-webdriver
gem install selenium-proxy
selenium webdriver无需代理即可运行。当我使用代理时,得到 未初始化的常量Selenium :: Proxy(NameError)。
答案 0 :(得分:-1)
Selenium :: WebDriver :: Proxy.new(http:PROXY)