Is it even possible ? I currently have : require 'selenium-webdriver' phantomjs_useragent = {"phantomjs.page.settings.userAgent" => "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"} driver = Selenium::WebDriver.for :phantomjs driver.capabilities.merge!(phantomjs_useragent) driver.navigate.to "http://whatsmyuseragent.com/"