Skip to content

Commit

Permalink
Set language preference for Firefox and Chrome drivers to English (en…
Browse files Browse the repository at this point in the history
…-us)
  • Loading branch information
david96182 committed Apr 24, 2024
1 parent c429e6e commit a2f502d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ninjemail/utils/webdriver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def create_driver(browser, captcha_extension=False, proxy=None):
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--headless')
custom_profile.set_preference("intl.accept_languages", "en-us")

# proxy
if proxy:
Expand All @@ -64,7 +65,9 @@ def create_driver(browser, captcha_extension=False, proxy=None):
options = ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_experimental_option('prefs', {'intl.accept_languages': 'en-us'})
options.add_argument('--headless=new')
options.add_experimental_option('excludeSwitches', ['enable-logging'])
if proxy:
options.add_argument(f'--proxy-server={proxy}')
if captcha_extension:
Expand Down

0 comments on commit a2f502d

Please sign in to comment.