我想在 selenium 自动化中以给定语言启动 Firefox 浏览器。我可以这样做吗?如果是这样,请分享一些示例代码实现。
提前致谢。
在启动驱动程序之前,在 Fire Fox 配置文件首选项中设置语言代码,如下所示。
FirefoxProfile ffprofile = new FirefoxProfile();
//For japenese language
ffprofile.setPreference("intl.accept_languages","ja");
driver = new FirefoxDriver(ffprofile);
driver.get("https://www.google.com");
对于语言代码:https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)