Can someone pls tell me how to switch the user agent using webdriver in Java? I tried below, but getting errors.
FirefoxProfile ffp = new FirefoxProfile();
ffp.
I needed to do it for Chrome, and needed to set a specific string (not fitting as platform, browser or version) for Googlebot.
// import org.openqa.selenium.chrome.ChromeOptions;
ChromeOptions options = new ChromeOptions();
options.addArguments("user-agent=\"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"");
new ChromeDriver(options);