我正在尝试在 selenium webdriver (2.25) 的 ruby (1.8.7) 脚本中使用 PhantomJS 1.9.1 配置代理。
我看到了一些使用 Firefox 的例子,我用这个浏览器成功地做到了。我使用了这段代码:
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :ssl => 'chronos.landebitel.local:3128'
$browser = Watir::Browser.new :firefox, :profile => profile
但我找不到 phantomjs 的任何示例。我搜索并尝试了很多解决方案,但没有一个有效。
有人可以举个例子来帮助我吗?
Try:
Watir::Browser.new( :phantomjs,
args: '--proxy=localhost:8181'
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)