From dc444aa3138412a8ca317033ab3c4a91c1462e83 Mon Sep 17 00:00:00 2001 From: Jimmy Engelbrecht Date: Tue, 22 Oct 2024 16:14:31 +0200 Subject: [PATCH 1/3] fix indentation error. --- seleniumbase/plugins/driver_manager.py | 90 +++++++++++++------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/seleniumbase/plugins/driver_manager.py b/seleniumbase/plugins/driver_manager.py index 0041da03dd4..9f67e18fb21 100644 --- a/seleniumbase/plugins/driver_manager.py +++ b/seleniumbase/plugins/driver_manager.py @@ -447,28 +447,28 @@ def Driver( break count += 1 window_position = w_p - if window_position: - if window_position.count(",") != 1: - message = ( - '\n\n window_position expects an "x,y" string!' - '\n (Your input was: "%s")\n' % window_position - ) - raise Exception(message) - window_position = window_position.replace(" ", "") - win_x = None - win_y = None - try: - win_x = int(window_position.split(",")[0]) - win_y = int(window_position.split(",")[1]) - except Exception: - message = ( - '\n\n Expecting integer values for "x,y"!' - '\n (window_position input was: "%s")\n' - % window_position - ) - raise Exception(message) - settings.WINDOW_START_X = win_x - settings.WINDOW_START_Y = win_y + if window_position: + if window_position.count(",") != 1: + message = ( + '\n\n window_position expects an "x,y" string!' + '\n (Your input was: "%s")\n' % window_position + ) + raise Exception(message) + window_position = window_position.replace(" ", "") + win_x = None + win_y = None + try: + win_x = int(window_position.split(",")[0]) + win_y = int(window_position.split(",")[1]) + except Exception: + message = ( + '\n\n Expecting integer values for "x,y"!' + '\n (window_position input was: "%s")\n' + % window_position + ) + raise Exception(message) + settings.WINDOW_START_X = win_x + settings.WINDOW_START_Y = win_y w_s = window_size if w_s is None and "--window-size" in arg_join: count = 0 @@ -483,29 +483,29 @@ def Driver( break count += 1 window_size = w_s - if window_size: - if window_size.count(",") != 1: - message = ( - '\n\n window_size expects a "width,height" string!' - '\n (Your input was: "%s")\n' % window_size - ) - raise Exception(message) - window_size = window_size.replace(" ", "") - width = None - height = None - try: - width = int(window_size.split(",")[0]) - height = int(window_size.split(",")[1]) - except Exception: - message = ( - '\n\n Expecting integer values for "width,height"!' - '\n (window_size input was: "%s")\n' % window_size - ) - raise Exception(message) - settings.CHROME_START_WIDTH = width - settings.CHROME_START_HEIGHT = height - settings.HEADLESS_START_WIDTH = width - settings.HEADLESS_START_HEIGHT = height + if window_size: + if window_size.count(",") != 1: + message = ( + '\n\n window_size expects a "width,height" string!' + '\n (Your input was: "%s")\n' % window_size + ) + raise Exception(message) + window_size = window_size.replace(" ", "") + width = None + height = None + try: + width = int(window_size.split(",")[0]) + height = int(window_size.split(",")[1]) + except Exception: + message = ( + '\n\n Expecting integer values for "width,height"!' + '\n (window_size input was: "%s")\n' % window_size + ) + raise Exception(message) + settings.CHROME_START_WIDTH = width + settings.CHROME_START_HEIGHT = height + settings.HEADLESS_START_WIDTH = width + settings.HEADLESS_START_HEIGHT = height if agent is None and "--agent" in arg_join: count = 0 for arg in sys_argv: From 91d8e2d91bf3b68dcde7f879e771151ac3624266 Mon Sep 17 00:00:00 2001 From: Jimmy Engelbrecht Date: Tue, 22 Oct 2024 18:31:45 +0200 Subject: [PATCH 2/3] Chrome 130 seems to have dropped support for. --- seleniumbase/core/browser_launcher.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index 01cba62c226..e9bb20d3498 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -1854,12 +1854,6 @@ def _set_chrome_options( multi_proxy, ) chrome_options.add_argument("--proxy-pac-url=%s" % proxy_pac_url) - if ( - not is_using_uc(undetectable, browser_name) - or not enable_ws - or proxy_string - ): - chrome_options.add_argument("--ignore-certificate-errors") if not enable_ws: chrome_options.add_argument("--disable-web-security") if ( From 7ad8ca10ffc172703f8525e9b9e5fa37cc8ec75f Mon Sep 17 00:00:00 2001 From: Jimmy Engelbrecht Date: Wed, 23 Oct 2024 15:34:59 +0200 Subject: [PATCH 3/3] locale_code should set lang instead of just intl.accept_languages --- seleniumbase/core/browser_launcher.py | 1 + 1 file changed, 1 insertion(+) diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index e9bb20d3498..325e74bffbf 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -1620,6 +1620,7 @@ def _set_chrome_options( prefs["profile.default_content_setting_values.automatic_downloads"] = 1 if locale_code: prefs["intl.accept_languages"] = locale_code + chrome_options.add_argument(f"--lang={locale_code}") if block_images: prefs["profile.managed_default_content_settings.images"] = 2 if disable_cookies: