Skip to content

Commit 1c60c16

Browse files
authored
Merge pull request #2321 from seleniumbase/fix-recorder-bug-and-refresh-dependencies
Fix a Recorder bug, optimize things, and refresh dependencies
2 parents 7d9d5c5 + 743385e commit 1c60c16

File tree

10 files changed

+65
-35
lines changed

10 files changed

+65
-35
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ pytest --reruns=1 --reruns-delay=1
13811381
13821382
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="240" /></a></div> <div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://img.shields.io/gitter/room/seleniumbase/SeleniumBase.svg" alt="Gitter chat"/></a></div>
13831383
<div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a></div>
1384-
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://hits.dwyl.com/seleniumbase/hits.svg" alt="visitor badge"/></a> (since Sep 15, 2023)</div>
1384+
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://hits.dwyl.com/seleniumbase/hits.svg" alt="visitor badge"/></a></div>
13851385
<div><a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a></div>
13861386
13871387
--------

help_docs/handling_iframes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ To back out of all nested calls of that, use:
5555
self.set_content_to_default()
5656
```
5757

58-
🖼️ See [examples/iframe_tests.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/iframe_tests.py) for tests that use all available iframe commands.
58+
🖼️ 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.
5959

6060
--------
6161

mkdocs_build/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
regex>=2023.10.3
55
PyYAML>=6.0.1
6-
pymdown-extensions>=10.4
6+
pymdown-extensions>=10.5
77
pipdeptree>=2.13.1
88
python-dateutil>=2.8.2
99
Markdown==3.5.1
@@ -20,7 +20,7 @@ paginate==0.5.6
2020
pyquery==2.0.0
2121
readtime==3.0.0
2222
mkdocs==1.5.3
23-
mkdocs-material==9.4.8
23+
mkdocs-material==9.4.14
2424
mkdocs-exclude-search==0.6.5
2525
mkdocs-simple-hooks==0.1.5
26-
mkdocs-material-extensions==1.3
26+
mkdocs-material-extensions==1.3.1

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
pip>=23.3.1
22
packaging>=23.2
33
setuptools>=68.0.0;python_version<"3.8"
4-
setuptools>=68.2.2;python_version>="3.8"
5-
wheel>=0.41.3
4+
setuptools>=69.0.2;python_version>="3.8"
5+
wheel>=0.42.0
66
attrs>=23.1.0
7-
certifi>=2023.7.22
7+
certifi>=2023.11.17
88
filelock>=3.12.2;python_version<"3.8"
99
filelock>=3.13.1;python_version>="3.8"
1010
platformdirs>=4.0.0
11-
parse>=1.19.1
11+
parse>=1.20.0
1212
parse-type>=0.6.2
1313
six==1.16.0
14-
idna==3.4
14+
idna==3.6
1515
chardet==5.2.0
1616
charset-normalizer==3.3.2
1717
urllib3>=1.26.18,<2;python_version<"3.10"
@@ -39,20 +39,20 @@ pytest==7.4.3
3939
pytest-html==2.0.1
4040
pytest-metadata==3.0.0
4141
pytest-ordering==0.6
42-
pytest-rerunfailures==12.0
43-
pytest-xdist==3.4.0
42+
pytest-rerunfailures==13.0
43+
pytest-xdist==3.5.0
4444
parameterized==0.9.0
4545
sbvirtualdisplay==1.3.0
4646
behave==1.2.6
4747
soupsieve==2.4.1;python_version<"3.8"
4848
soupsieve==2.5;python_version>="3.8"
4949
beautifulsoup4==4.12.2
50-
pygments==2.16.1
50+
pygments==2.17.2
5151
pyreadline3==3.4.1;platform_system=="Windows"
5252
tabcompleter==1.3.0
5353
pdbp==1.5.0
5454
colorama==0.4.6
55-
exceptiongroup==1.1.3
55+
exceptiongroup==1.2.0
5656
pyotp==2.9.0
5757
markdown-it-py==2.2.0;python_version<"3.8"
5858
markdown-it-py==3.0.0;python_version>="3.8"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.21.4"
2+
__version__ = "4.21.5"

seleniumbase/console_scripts/sb_mkrec.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def main():
9999
force_gui = False
100100
rec_behave = False
101101

102+
sys_executable = sys.executable
103+
if " " in sys_executable:
104+
sys_executable = "python"
105+
102106
if "linux" in sys.platform:
103107
use_colors = False
104108
c0, c1, c2, c5, c7, cr = set_colors(use_colors)
@@ -189,18 +193,18 @@ def main():
189193
print(success)
190194
run_cmd = None
191195
if not start_page:
192-
run_cmd = "%s -m pytest %s --rec -q -s" % (sys.executable, file_name)
196+
run_cmd = "%s -m pytest %s --rec -q -s" % (sys_executable, file_name)
193197
else:
194198
run_cmd = "%s -m pytest %s --rec -q -s --url=%s" % (
195-
sys.executable, file_name, start_page
199+
sys_executable, file_name, start_page
196200
)
197201
if '"' not in start_page:
198202
run_cmd = '%s -m pytest %s --rec -q -s --url="%s"' % (
199-
sys.executable, file_name, start_page
203+
sys_executable, file_name, start_page
200204
)
201205
elif "'" not in start_page:
202206
run_cmd = "%s -m pytest %s --rec -q -s --url='%s'" % (
203-
sys.executable, file_name, start_page
207+
sys_executable, file_name, start_page
204208
)
205209
if use_edge:
206210
run_cmd += " --edge"
@@ -217,7 +221,7 @@ def main():
217221
recorded_filename = file_name[:-3] + "_rec.py"
218222
recordings_dir = os.path.join(dir_name, "recordings")
219223
recorded_file = os.path.join(recordings_dir, recorded_filename)
220-
prefix = "%s -m " % sys.executable
224+
prefix = "%s -m " % sys_executable
221225
if " " not in recorded_file:
222226
os.system("%sseleniumbase print %s -n" % (prefix, recorded_file))
223227
elif '"' not in recorded_file:

seleniumbase/console_scripts/sb_recorder.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
sb_config.rec_subprocess_p = None
2626
sb_config.rec_subprocess_used = False
27+
sys_executable = sys.executable
28+
if " " in sys_executable:
29+
sys_executable = "python"
2730
if sys.version_info <= (3, 7):
2831
current_version = ".".join(str(ver) for ver in sys.version_info[:3])
2932
raise Exception(
@@ -139,17 +142,17 @@ def do_recording(file_name, url, overwrite_enabled, use_chrome, window):
139142
add_on = " --rec-behave"
140143
command = (
141144
"%s -m seleniumbase mkrec %s --url=%s --gui"
142-
% (sys.executable, file_name, url)
145+
% (sys_executable, file_name, url)
143146
)
144147
if '"' not in url:
145148
command = (
146149
'%s -m seleniumbase mkrec %s --url="%s" --gui'
147-
% (sys.executable, file_name, url)
150+
% (sys_executable, file_name, url)
148151
)
149152
elif "'" not in url:
150153
command = (
151154
"%s -m seleniumbase mkrec %s --url='%s' --gui"
152-
% (sys.executable, file_name, url)
155+
% (sys_executable, file_name, url)
153156
)
154157
if not use_chrome:
155158
command += " --edge"
@@ -185,7 +188,7 @@ def do_playback(file_name, use_chrome, window, demo_mode=False):
185188
'File "%s" does not exist in the current directory!' % file_name,
186189
)
187190
return
188-
command = "%s -m pytest %s -q -s" % (sys.executable, file_name)
191+
command = "%s -m pytest %s -q -s" % (sys_executable, file_name)
189192
if shared_utils.is_linux():
190193
command += " --gui"
191194
if not use_chrome:

seleniumbase/core/browser_launcher.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,6 +2874,22 @@ def get_local_driver(
28742874
driver_version = saved_mcv
28752875
if is_using_uc(undetectable, browser_name):
28762876
use_br_version_for_uc = True
2877+
if (
2878+
(headless or headless2)
2879+
and IS_WINDOWS
2880+
and major_chrome_version
2881+
and int(major_chrome_version) >= 117
2882+
and not is_using_uc(undetectable, browser_name)
2883+
and not (remote_debug or devtools or use_wire)
2884+
and not (proxy_string or multi_proxy or proxy_pac_url)
2885+
and (not chromium_arg or "debug" not in chromium_arg)
2886+
and (not servername or servername == "localhost")
2887+
):
2888+
# Hide the "DevTools listening on ..." message.
2889+
# https://bugs.chromium.org
2890+
# /p/chromedriver/issues/detail?id=4403#c35
2891+
# (Only when the remote debugging port is not needed.)
2892+
chrome_options.add_argument("--remote-debugging-pipe")
28772893
except Exception:
28782894
major_chrome_version = None
28792895
if major_chrome_version:

seleniumbase/undetected/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,16 @@ def __init__(
214214
language = "en-US"
215215
options.add_argument("--lang=%s" % language)
216216
if not options.binary_location:
217-
options.binary_location = (
217+
binary_location = (
218218
browser_executable_path or find_chrome_executable()
219219
)
220+
if binary_location:
221+
options.binary_location = binary_location
222+
else:
223+
# Improve the default error message in this situation.
224+
# Setting options.binary_location to None results in:
225+
# "TypeError: Binary Location Must be a String"
226+
raise Exception("Chrome not found! Install it first!")
220227
self._delay = constants.UC.RECONNECT_TIME
221228
self.user_data_dir = user_data_dir
222229
self.keep_user_data_dir = keep_user_data_dir

setup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@
134134
'pip>=23.3.1',
135135
'packaging>=23.2',
136136
'setuptools>=68.0.0;python_version<"3.8"',
137-
'setuptools>=68.2.2;python_version>="3.8"',
138-
'wheel>=0.41.3',
137+
'setuptools>=69.0.2;python_version>="3.8"',
138+
'wheel>=0.42.0',
139139
'attrs>=23.1.0',
140-
"certifi>=2023.7.22",
140+
"certifi>=2023.11.17",
141141
'filelock>=3.12.2;python_version<"3.8"',
142142
'filelock>=3.13.1;python_version>="3.8"',
143143
'platformdirs>=4.0.0',
144-
'parse>=1.19.1',
144+
'parse>=1.20.0',
145145
'parse-type>=0.6.2',
146146
"six==1.16.0",
147-
"idna==3.4",
147+
"idna==3.6",
148148
'chardet==5.2.0',
149149
'charset-normalizer==3.3.2',
150150
'urllib3>=1.26.18,<2;python_version<"3.10"',
@@ -172,20 +172,20 @@
172172
"pytest-html==2.0.1", # Newer ones had issues
173173
'pytest-metadata==3.0.0',
174174
"pytest-ordering==0.6",
175-
'pytest-rerunfailures==12.0',
176-
'pytest-xdist==3.4.0',
175+
'pytest-rerunfailures==13.0',
176+
'pytest-xdist==3.5.0',
177177
'parameterized==0.9.0',
178178
"sbvirtualdisplay==1.3.0",
179179
"behave==1.2.6",
180180
'soupsieve==2.4.1;python_version<"3.8"',
181181
'soupsieve==2.5;python_version>="3.8"',
182182
"beautifulsoup4==4.12.2",
183-
'pygments==2.16.1',
183+
'pygments==2.17.2',
184184
'pyreadline3==3.4.1;platform_system=="Windows"',
185185
"tabcompleter==1.3.0",
186186
"pdbp==1.5.0",
187187
'colorama==0.4.6',
188-
'exceptiongroup==1.1.3',
188+
'exceptiongroup==1.2.0',
189189
'pyotp==2.9.0',
190190
'markdown-it-py==2.2.0;python_version<"3.8"',
191191
'markdown-it-py==3.0.0;python_version>="3.8"',
@@ -230,7 +230,7 @@
230230
"pdfminer": [
231231
'pdfminer.six==20221105',
232232
'cryptography==39.0.2;python_version<"3.9"',
233-
'cryptography==41.0.5;python_version>="3.9"',
233+
'cryptography==41.0.7;python_version>="3.9"',
234234
'cffi==1.15.1;python_version<"3.8"',
235235
'cffi==1.16.0;python_version>="3.8"',
236236
"pycparser==2.21",

0 commit comments

Comments
 (0)