diff --git a/README.md b/README.md index 470cc141ae2..5ddb1536507 100755 --- a/README.md +++ b/README.md @@ -1381,7 +1381,7 @@ pytest --reruns=1 --reruns-delay=1
SeleniumBase Docs
Tested with SeleniumBase
Gitter chat
SeleniumBase PyPI downloads
-
visitor badge (since Sep 15, 2023)
+
visitor badge
-------- diff --git a/help_docs/handling_iframes.md b/help_docs/handling_iframes.md index 6a28061246e..88d46255b87 100644 --- a/help_docs/handling_iframes.md +++ b/help_docs/handling_iframes.md @@ -55,7 +55,7 @@ To back out of all nested calls of that, use: self.set_content_to_default() ``` -🖼️ See [examples/iframe_tests.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/iframe_tests.py) for tests that use all available iframe commands. +🖼️ See [SeleniumBase/examples/iframe_tests.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/iframe_tests.py) for tests that use all available iframe commands. -------- diff --git a/mkdocs_build/requirements.txt b/mkdocs_build/requirements.txt index 8fb01cf898b..db3a668051f 100644 --- a/mkdocs_build/requirements.txt +++ b/mkdocs_build/requirements.txt @@ -3,7 +3,7 @@ regex>=2023.10.3 PyYAML>=6.0.1 -pymdown-extensions>=10.4 +pymdown-extensions>=10.5 pipdeptree>=2.13.1 python-dateutil>=2.8.2 Markdown==3.5.1 @@ -20,7 +20,7 @@ paginate==0.5.6 pyquery==2.0.0 readtime==3.0.0 mkdocs==1.5.3 -mkdocs-material==9.4.8 +mkdocs-material==9.4.14 mkdocs-exclude-search==0.6.5 mkdocs-simple-hooks==0.1.5 -mkdocs-material-extensions==1.3 +mkdocs-material-extensions==1.3.1 diff --git a/requirements.txt b/requirements.txt index 564726d270d..1f1134f802b 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ pip>=23.3.1 packaging>=23.2 setuptools>=68.0.0;python_version<"3.8" -setuptools>=68.2.2;python_version>="3.8" -wheel>=0.41.3 +setuptools>=69.0.2;python_version>="3.8" +wheel>=0.42.0 attrs>=23.1.0 -certifi>=2023.7.22 +certifi>=2023.11.17 filelock>=3.12.2;python_version<"3.8" filelock>=3.13.1;python_version>="3.8" platformdirs>=4.0.0 -parse>=1.19.1 +parse>=1.20.0 parse-type>=0.6.2 six==1.16.0 -idna==3.4 +idna==3.6 chardet==5.2.0 charset-normalizer==3.3.2 urllib3>=1.26.18,<2;python_version<"3.10" @@ -39,20 +39,20 @@ pytest==7.4.3 pytest-html==2.0.1 pytest-metadata==3.0.0 pytest-ordering==0.6 -pytest-rerunfailures==12.0 -pytest-xdist==3.4.0 +pytest-rerunfailures==13.0 +pytest-xdist==3.5.0 parameterized==0.9.0 sbvirtualdisplay==1.3.0 behave==1.2.6 soupsieve==2.4.1;python_version<"3.8" soupsieve==2.5;python_version>="3.8" beautifulsoup4==4.12.2 -pygments==2.16.1 +pygments==2.17.2 pyreadline3==3.4.1;platform_system=="Windows" tabcompleter==1.3.0 pdbp==1.5.0 colorama==0.4.6 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 pyotp==2.9.0 markdown-it-py==2.2.0;python_version<"3.8" markdown-it-py==3.0.0;python_version>="3.8" diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index c92f01d22ab..f04648ca2df 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.21.4" +__version__ = "4.21.5" diff --git a/seleniumbase/console_scripts/sb_mkrec.py b/seleniumbase/console_scripts/sb_mkrec.py index ca5ea143b96..3ee61b34eb8 100644 --- a/seleniumbase/console_scripts/sb_mkrec.py +++ b/seleniumbase/console_scripts/sb_mkrec.py @@ -99,6 +99,10 @@ def main(): force_gui = False rec_behave = False + sys_executable = sys.executable + if " " in sys_executable: + sys_executable = "python" + if "linux" in sys.platform: use_colors = False c0, c1, c2, c5, c7, cr = set_colors(use_colors) @@ -189,18 +193,18 @@ def main(): print(success) run_cmd = None if not start_page: - run_cmd = "%s -m pytest %s --rec -q -s" % (sys.executable, file_name) + run_cmd = "%s -m pytest %s --rec -q -s" % (sys_executable, file_name) else: run_cmd = "%s -m pytest %s --rec -q -s --url=%s" % ( - sys.executable, file_name, start_page + sys_executable, file_name, start_page ) if '"' not in start_page: run_cmd = '%s -m pytest %s --rec -q -s --url="%s"' % ( - sys.executable, file_name, start_page + sys_executable, file_name, start_page ) elif "'" not in start_page: run_cmd = "%s -m pytest %s --rec -q -s --url='%s'" % ( - sys.executable, file_name, start_page + sys_executable, file_name, start_page ) if use_edge: run_cmd += " --edge" @@ -217,7 +221,7 @@ def main(): recorded_filename = file_name[:-3] + "_rec.py" recordings_dir = os.path.join(dir_name, "recordings") recorded_file = os.path.join(recordings_dir, recorded_filename) - prefix = "%s -m " % sys.executable + prefix = "%s -m " % sys_executable if " " not in recorded_file: os.system("%sseleniumbase print %s -n" % (prefix, recorded_file)) elif '"' not in recorded_file: diff --git a/seleniumbase/console_scripts/sb_recorder.py b/seleniumbase/console_scripts/sb_recorder.py index ce07f343a41..26cddab1dfa 100644 --- a/seleniumbase/console_scripts/sb_recorder.py +++ b/seleniumbase/console_scripts/sb_recorder.py @@ -24,6 +24,9 @@ sb_config.rec_subprocess_p = None sb_config.rec_subprocess_used = False +sys_executable = sys.executable +if " " in sys_executable: + sys_executable = "python" if sys.version_info <= (3, 7): current_version = ".".join(str(ver) for ver in sys.version_info[:3]) raise Exception( @@ -139,17 +142,17 @@ def do_recording(file_name, url, overwrite_enabled, use_chrome, window): add_on = " --rec-behave" command = ( "%s -m seleniumbase mkrec %s --url=%s --gui" - % (sys.executable, file_name, url) + % (sys_executable, file_name, url) ) if '"' not in url: command = ( '%s -m seleniumbase mkrec %s --url="%s" --gui' - % (sys.executable, file_name, url) + % (sys_executable, file_name, url) ) elif "'" not in url: command = ( "%s -m seleniumbase mkrec %s --url='%s' --gui" - % (sys.executable, file_name, url) + % (sys_executable, file_name, url) ) if not use_chrome: command += " --edge" @@ -185,7 +188,7 @@ def do_playback(file_name, use_chrome, window, demo_mode=False): 'File "%s" does not exist in the current directory!' % file_name, ) return - command = "%s -m pytest %s -q -s" % (sys.executable, file_name) + command = "%s -m pytest %s -q -s" % (sys_executable, file_name) if shared_utils.is_linux(): command += " --gui" if not use_chrome: diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index 367b77fd69a..11779448b5d 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -2874,6 +2874,22 @@ def get_local_driver( driver_version = saved_mcv if is_using_uc(undetectable, browser_name): use_br_version_for_uc = True + if ( + (headless or headless2) + and IS_WINDOWS + and major_chrome_version + and int(major_chrome_version) >= 117 + and not is_using_uc(undetectable, browser_name) + and not (remote_debug or devtools or use_wire) + and not (proxy_string or multi_proxy or proxy_pac_url) + and (not chromium_arg or "debug" not in chromium_arg) + and (not servername or servername == "localhost") + ): + # Hide the "DevTools listening on ..." message. + # https://bugs.chromium.org + # /p/chromedriver/issues/detail?id=4403#c35 + # (Only when the remote debugging port is not needed.) + chrome_options.add_argument("--remote-debugging-pipe") except Exception: major_chrome_version = None if major_chrome_version: diff --git a/seleniumbase/undetected/__init__.py b/seleniumbase/undetected/__init__.py index 6419864f2a1..f45769f65d4 100644 --- a/seleniumbase/undetected/__init__.py +++ b/seleniumbase/undetected/__init__.py @@ -214,9 +214,16 @@ def __init__( language = "en-US" options.add_argument("--lang=%s" % language) if not options.binary_location: - options.binary_location = ( + binary_location = ( browser_executable_path or find_chrome_executable() ) + if binary_location: + options.binary_location = binary_location + else: + # Improve the default error message in this situation. + # Setting options.binary_location to None results in: + # "TypeError: Binary Location Must be a String" + raise Exception("Chrome not found! Install it first!") self._delay = constants.UC.RECONNECT_TIME self.user_data_dir = user_data_dir self.keep_user_data_dir = keep_user_data_dir diff --git a/setup.py b/setup.py index ed9aa37d5dd..1ce7bfe83de 100755 --- a/setup.py +++ b/setup.py @@ -134,17 +134,17 @@ 'pip>=23.3.1', 'packaging>=23.2', 'setuptools>=68.0.0;python_version<"3.8"', - 'setuptools>=68.2.2;python_version>="3.8"', - 'wheel>=0.41.3', + 'setuptools>=69.0.2;python_version>="3.8"', + 'wheel>=0.42.0', 'attrs>=23.1.0', - "certifi>=2023.7.22", + "certifi>=2023.11.17", 'filelock>=3.12.2;python_version<"3.8"', 'filelock>=3.13.1;python_version>="3.8"', 'platformdirs>=4.0.0', - 'parse>=1.19.1', + 'parse>=1.20.0', 'parse-type>=0.6.2', "six==1.16.0", - "idna==3.4", + "idna==3.6", 'chardet==5.2.0', 'charset-normalizer==3.3.2', 'urllib3>=1.26.18,<2;python_version<"3.10"', @@ -172,20 +172,20 @@ "pytest-html==2.0.1", # Newer ones had issues 'pytest-metadata==3.0.0', "pytest-ordering==0.6", - 'pytest-rerunfailures==12.0', - 'pytest-xdist==3.4.0', + 'pytest-rerunfailures==13.0', + 'pytest-xdist==3.5.0', 'parameterized==0.9.0', "sbvirtualdisplay==1.3.0", "behave==1.2.6", 'soupsieve==2.4.1;python_version<"3.8"', 'soupsieve==2.5;python_version>="3.8"', "beautifulsoup4==4.12.2", - 'pygments==2.16.1', + 'pygments==2.17.2', 'pyreadline3==3.4.1;platform_system=="Windows"', "tabcompleter==1.3.0", "pdbp==1.5.0", 'colorama==0.4.6', - 'exceptiongroup==1.1.3', + 'exceptiongroup==1.2.0', 'pyotp==2.9.0', 'markdown-it-py==2.2.0;python_version<"3.8"', 'markdown-it-py==3.0.0;python_version>="3.8"', @@ -230,7 +230,7 @@ "pdfminer": [ 'pdfminer.six==20221105', 'cryptography==39.0.2;python_version<"3.9"', - 'cryptography==41.0.5;python_version>="3.9"', + 'cryptography==41.0.7;python_version>="3.9"', 'cffi==1.15.1;python_version<"3.8"', 'cffi==1.16.0;python_version>="3.8"', "pycparser==2.21",