Skip to content

Commit 5212bdb

Browse files
authored
Merge pull request #3117 from seleniumbase/stealthier-recorder-and-more
Stealthier Recorder and more
2 parents 4c455c4 + b1698a1 commit 5212bdb

File tree

13 files changed

+117
-39
lines changed

13 files changed

+117
-39
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
1616

17-
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></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></p>
17+
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a></p>
1818

1919
<p align="center">
2020
<a href="#python_installation">🚀 Start</a> |
@@ -1361,22 +1361,23 @@ pytest --reruns=1 --reruns-delay=1
13611361
<div><a href="https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88" title="Closed Issues" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/seleniumbase/SeleniumBase.svg?logo=github&logoColor=white&color=22BB99" title="Closed Pull Requests" /></a></div>
13621362
</p>
13631363
1364-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="266" /></a></p>
1364+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="274" /></a></p>
13651365
13661366
<a href="https://pypi.org/project/seleniumbase/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python&logoColor=FEDC54" title="Supported Python Versions" /></a>
13671367
13681368
<p><div>
1369-
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="68" /></a></span>
1370-
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="62" /></a></span>
1371-
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="64" /></a></span>
1372-
<span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="50" /></a></span>
1369+
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="70" /></a></span>
1370+
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="64" /></a></span>
1371+
<span><a href="https://discord.gg/EdhQTn3EyE"><img src="https://seleniumbase.github.io/other/discord_icon.png" title="SeleniumBase on Discord" alt="SeleniumBase on Discord" width="66" /></a></span>
1372+
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="62" /></a></span>
1373+
<span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="48" /></a></span>
13731374
</div></p>
13741375
13751376
<p><div><b><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></b></div></p>
13761377
1377-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" title="SeleniumBase" width="240" /></a></div>
1378-
<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>
1379-
<div><a href="https://hellogithub.com/repository/c6be2d0f1969448697683d11a4ff915e" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=c6be2d0f1969448697683d11a4ff915e&claim_uid=xcrm4p9j3d6JCO5" alt="Featured|HelloGitHub" style="width: 173px; height: 38px;" width="173" height="38" /></a></div>
1380-
<div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a></div>
1381-
<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>
1382-
<div align="left"><img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="124px" height="28px" alt="Views" /></div>
1378+
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" title="SeleniumBase" width="274" /></a></div>
1379+
<div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a></div>
1380+
<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> <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>
1381+
<div><a href="https://hellogithub.com/repository/c6be2d0f1969448697683d11a4ff915e" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=c6be2d0f1969448697683d11a4ff915e&claim_uid=xcrm4p9j3d6JCO5&theme=small" alt="Featured|HelloGitHub" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></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>
1382+
<div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="98px" height="20px" alt="Views" /></div>
1383+
<div align="left"></div>

examples/ReadMe.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ python gui_test_runner.py
251251

252252
--------
253253

254+
<h3><a href="https://discord.gg/EdhQTn3EyE"><img src="https://seleniumbase.github.io/other/discord_icon.png" title="Join the SeleniumBase chat on Discord" alt="Join the SeleniumBase chat on Discord" width="44" /></a> <a href="https://discord.gg/EdhQTn3EyE">Join the SeleniumBase chat on Discord!</a></h3>
255+
256+
Ask questions. Find answers. Learn how to automate!
257+
258+
--------
259+
254260
<img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="320" />
255261

256262
<a href="https://github.com/seleniumbase/SeleniumBase">

integrations/github/workflows/extras.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<h3><img src="https://seleniumbase.github.io/img/logo3a.png" title="SeleniumBase" width="32" /> Integrations for GitHub Actions:</h3>
22

33
### Uploading Artifacts:
4-
* Here's an example using [upload-artifact@v2](https://github.com/actions/upload-artifact) to push up a SeleniumBase-generated artifact.
4+
* Here's an example using [upload-artifact@v4](https://github.com/actions/upload-artifact) to push up a SeleniumBase-generated artifact.
55

6-
```
7-
- uses: actions/upload-artifact@v2
6+
```yml
7+
- uses: actions/upload-artifact@v4
88
with:
99
name: Click to download the presentation
1010
path: saved_presentations/my_presentation.html
@@ -18,7 +18,7 @@
1818
* For this particular action, ``SLACK_CHANNEL`` is an optional environment variable that defaults to the webhook token channel if not specified.
1919
* The following example shows how to put a link to your workflow as the ``SLACK_MESSAGE`` (Lets you see artifacts pushed up, such as from the SeleniumBase Presenter feature!):
2020
21-
```
21+
```yml
2222
- name: Slack notification
2323
uses: rtCamp/action-slack-notify@master
2424
env:

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ plugins:
7575
- examples/case_summary.md
7676
- help_docs/chinese.md
7777
- integrations/katalon/ReadMe.md
78+
- help_docs/ReadMe.md
7879
- help_docs/verify_webdriver.md
7980
- help_docs/webdriver_installation.md
8081
- seleniumbase/masterqa/ReadMe.md

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
regex>=2024.7.24
55
pymdown-extensions>=10.9
6-
pipdeptree>=2.23.1
6+
pipdeptree>=2.23.3
77
python-dateutil>=2.8.2
88
Markdown==3.7
99
markdown2==2.5.0

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ attrs>=24.2.0
1111
certifi>=2024.8.30
1212
exceptiongroup>=1.2.2
1313
filelock>=3.12.2;python_version<"3.8"
14-
filelock>=3.15.4;python_version>="3.8"
14+
filelock>=3.16.0;python_version>="3.8"
1515
platformdirs>=4.0.0;python_version<"3.8"
16-
platformdirs>=4.2.2;python_version>="3.8"
16+
platformdirs>=4.3.2;python_version>="3.8"
1717
typing-extensions>=4.12.2;python_version>="3.8"
1818
parse>=1.20.2
1919
parse-type>=0.6.3
@@ -47,7 +47,7 @@ pluggy==1.2.0;python_version<"3.8"
4747
pluggy==1.5.0;python_version>="3.8"
4848
py==1.11.0
4949
pytest==7.4.4;python_version<"3.8"
50-
pytest==8.3.2;python_version>="3.8"
50+
pytest==8.3.3;python_version>="3.8"
5151
pytest-html==2.0.1
5252
pytest-metadata==3.0.0;python_version<"3.8"
5353
pytest-metadata==3.1.1;python_version>="3.8"
@@ -73,7 +73,7 @@ python-xlib==0.33;platform_system=="Linux"
7373
markdown-it-py==2.2.0;python_version<"3.8"
7474
markdown-it-py==3.0.0;python_version>="3.8"
7575
mdurl==0.1.2
76-
rich==13.8.0
76+
rich==13.8.1
7777

7878
# --- Testing Requirements --- #
7979
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)

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.30.3"
2+
__version__ = "4.30.4"

seleniumbase/common/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- SeleniumBase Docs -->
22

3-
## Using [seleniumbase/common](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common) methods.
3+
## [seleniumbase/common](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common) decorators and security.
44

55
### Part 1: Decorators - (from [decorators.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/decorators.py))
66

seleniumbase/console_scripts/sb_mkrec.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,28 @@ def main():
181181
data.append("")
182182
data.append("class RecorderTest(BaseCase):")
183183
data.append(" def test_recording(self):")
184+
if use_uc:
185+
data.append(" if self.undetectable:")
186+
if (
187+
start_page
188+
and (
189+
start_page.startswith("http:")
190+
or start_page.startswith("https:")
191+
or start_page.startswith("file:")
192+
)
193+
):
194+
used_sp = start_page
195+
if '"' not in start_page:
196+
used_sp = '"%s"' % start_page
197+
elif "'" not in start_page:
198+
used_sp = "'%s'" % start_page
199+
data.append(
200+
" self.uc_open_with_disconnect(\n"
201+
" %s\n"
202+
" )" % used_sp
203+
)
204+
else:
205+
data.append(" self.disconnect()")
184206
data.append(" if self.recorder_ext:")
185207
data.append(" # When done recording actions,")
186208
data.append(' # type "c", and press [Enter].')
@@ -231,7 +253,18 @@ def main():
231253
)
232254
print(success)
233255
run_cmd = None
234-
if not start_page:
256+
if (
257+
not start_page
258+
or (
259+
use_uc
260+
and (
261+
start_page.startswith("http:")
262+
or start_page.startswith("https:")
263+
or start_page.startswith("file:")
264+
)
265+
and not esc_end
266+
)
267+
):
235268
run_cmd = "%s -m pytest %s --rec -q -s" % (sys_executable, file_name)
236269
else:
237270
run_cmd = "%s -m pytest %s --rec -q -s --url=%s" % (

seleniumbase/console_scripts/sb_recorder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ def do_playback(file_name, use_chrome, window, demo_mode=False):
197197
command += " --edge"
198198
if demo_mode:
199199
command += " --demo"
200+
command_args = sys.argv[2:]
201+
if (
202+
"--uc" in command_args
203+
or "--undetected" in command_args
204+
or "--undetectable" in command_args
205+
):
206+
command += " --uc"
200207
poll = None
201208
if sb_config.rec_subprocess_used:
202209
poll = sb_config.rec_subprocess_p.poll()

0 commit comments

Comments
 (0)