0

I am trying to use the below code to convert a web page from Swedish to English language:

chrome_options.add_argument("--lang=en-US")

I also tried the below:

            'profile.default_content_settings.images': 2,
            'translate_whitelists': {
                'se':'en',
                'el':'en',
                }, 
            'translate':{'enabled':'True'}, 
            'intl.accept_languages': 'en,en_US',
             }) 

None of them worked. The code has to be in Python Selenium

user13074756
  • 383
  • 1
  • 8
  • 16

1 Answers1

0

Try below code -

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

browser_locale = 'en'
chrome_driver_path = 'chromedriver.exe'

options = Options()
options.add_argument("--lang={}".format(browser_locale))

browser = webdriver.Chrome(executable_path=chrome_driver_path,
                           chrome_options=options)
browser.get('https://google.com/')

Make the changes as it suits you.

Swaroop Humane
  • 1,770
  • 1
  • 7
  • 17