我有一个 ruby 网络爬虫,目前已编码为在 Firefox 中运行。如何将其切换到 Chrome?
def open_browser()
tweaked_profile = Selenium::WebDriver::Firefox::Profile.new
tweaked_profile['nglayout.initialpaint.delay'] = 0
tweaked_profile.assume_untrusted_certificate_issuer=false
tweaked_profile['permissions.default.image'] = 2
tweaked_profile['network.proxy.type'] = 1
tweaked_profile['network.proxy.http'] = 'ec2proxy.csnzoo.com'
tweaked_profile['network.proxy.http_port'] = 8080
driver = Selenium::WebDriver.for :firefox, :profile => tweaked_profile
$browser = Watir::Browser.new(driver)
end
我应该放弃 watir 并使用 chromedriver 还是 watir 会为此工作?