Set Chrome's language using Selenium ChromeDriver

后端 未结 7 1310
囚心锁ツ
囚心锁ツ 2020-12-05 18:24

I download ChromeDriver and by defaults the browser language is in English, I need to change it to Spanish, and I have been unable.

public WebDriver getDrive         


        
相关标签:
7条回答
  • 2020-12-05 18:58

    For people using Selenium with ruby:

    I made it work this way:

    prefs_hash = {
           'credentials_enable_service' => false,
           'profile' => {
               'password_manager_enabled' => false,
           },
           'intl.accept_languages' => 'fr-FR', // <- here
        }
    
    // [...]
    
    browser = Watir::Browser.new :chrome, :prefs => prefs_hash, switches: switches, desired_capabilities: caps
    
    
    0 讨论(0)
提交回复
热议问题