他们是一种为网页预定义语言的方法吗?我想用西类牙语加载 google 页面,我们可以设置 webdriver 的属性,使其以西类牙语加载页面吗?
最佳答案
检查 this链接:
对于火狐:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference( "intl.accept_languages", "es" );
WebDriver driver = new FirefoxDriver(profile);
对于 Chrome:
ChromeOptions options = new ChromeOptions();
options.AddArguments("--lang=es");
ChromeDriver driver = new ChromeDriver(options);
关于java - 如何使用 Selenium(Java) 更改网页中的语言?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29788425/