Pyhon examples
Note. I am testing it with the accepted language "en, en_US", but I do not understand why it will not work with de_DE if the language is available on the system.
This work with selenium
from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options from splinter.driver.webdriver import BaseWebDriver, WebDriverElement options = Options() options.add_experimental_option('prefs', {'intl.accept_languages': 'de_DE'}) browser = BaseWebDriver() browser.driver = Chrome(chrome_options=options) browser.visit('http://example.com')
There are 2 options for a shard:
Splinter Interface Only
from splinter import Browser from splinter.driver.webdriver.chrome import Options options = Options() options.add_experimental_option('prefs', {'intl.accept_languages': 'de_DE'}) browser = Browser('chrome', options=options) browser.visit('http://example.com')
Shard and Selenium API
from splinter import Browser from selenium import webdriver options = webdriver.ChromeOptions() options.add_experimental_option('prefs', {'intl.accept_languages': 'de_DE'}) browser = Browser('chrome', options=options) browser.visit('http://example.com')
source share