You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b9fcffd
Browse filesBrowse the repository at this point in the historyBrowse files
📊 <ahref="https://github.com/seleniumbase/SeleniumBase/"><btranslate="no">SeleniumBase</b></a> is a complete framework for browser automation and testing with Python and <ahref="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a>. Includes stealth options and other advanced features.
56
-
57
-
🐙 Stealth modes: <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md">UC Mode</a> and <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> can bypass bot-detection, handle CAPTCHAs, and call methods from the <ahref="https://chromedevtools.github.io/devtools-protocol/"translate="no">Chrome Devtools Protocol</a>. CDP Mode includes <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md"><b><spantranslate="no">Stealthy Playwright Mode</span></b></a>, which makes Playwright stealthy.
58
-
59
-
📚 The [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder includes over 100 ready-to-run examples. Examples that start with `test_` or end with `_test.py`/`_tests.py` are specifically designed to run with `pytest`. Other examples run directly with raw `python` (those files generally start with `raw_` to avoid confusion).
53
+
--------
60
54
61
-
🥷 Stealthy examples are located in [SeleniumBase/examples/cdp_mode/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/cdp_mode).
55
+
🥷 Stealth modes: <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b></a> / <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> can bypass bot-detection, handle CAPTCHAs, and call methods from the <ahref="https://chromedevtools.github.io/devtools-protocol/"translate="no">Chrome Devtools Protocol</a>. CDP Mode includes <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md"><b><spantranslate="no">Stealthy Playwright Mode</span></b></a>, which makes Playwright stealthy.
62
56
63
-
--------
57
+
🧪 End-to-End Testing examples are located in [./examples/](https://github.com/seleniumbase/SeleniumBase/blob/master/examples).
🎭 Stealthy Playwright examples are located in [./examples/cdp_mode/playwright/](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/).
68
62
69
-
(For maximum stealth, use <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md">CDP Mode</a>, which includes <atranslate="no"href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md">Stealthy Playwright Mode</a>)
63
+
📚 Examples that have `test_` or `_test` in the filename are specifically designed to run with `pytest` / `pynose`. Other examples run directly with raw `python` (those files generally start with `raw_` to avoid confusion).
✅ <b><code>sb.solve_captcha()</code></b> handles CAPTCHAs that aren't bypassed automatically.<br />(If called when there's no CAPTCHA on the page, then nothing happens / no-op.)
<palign="left">📝 Here’s <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_cdp_methods.py"target="_blank">SeleniumBase/examples/cdp_mode/raw_cdp_methods.py</a>:<br />(It performs several different actions on the web page)</p>
118
-
119
-
```python
120
-
from seleniumbase import sb_cdp
121
-
122
-
sb = sb_cdp.Chrome(fast=True)
123
-
sb.goto("https://seleniumbase.io/demo_page")
124
-
sb.type("input", "Quickly type text!")
125
-
sb.press_keys("textarea", "Slowly type text!")
126
-
sb.click("#myButton")
127
-
sb.set_value("input#mySlider", "100")
128
-
sb.click_visible_elements("input.checkBoxClassB")
129
-
sb.select_option_by_text("#mySelect", "Set to 75%")
🧪 End-to-End Testing examples are located in [./examples/](https://github.com/seleniumbase/SeleniumBase/blob/master/examples).
169
-
170
-
🐙 Stealthy CDP Mode examples are located in [./examples/cdp_mode/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/cdp_mode).
171
-
172
-
🎭 Stealthy Playwright examples are located in [./examples/cdp_mode/playwright/](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/).
173
-
174
-
--------
175
-
176
137
<h3align="left">🌐 CLI Options for Supported Chromium Browsers</h3>
177
138
178
-
<p>💡 You can set the Chromium browser to use via commandline parameters:</p>
139
+
<p>💡 You can set which Chromium browser to use via command-line parameters:</p>
179
140
180
141
```zsh
181
142
python SCRIPT.py --chromium # Use the unbranded Chromium browser
📚 The [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder includes over 150 ready-to-run examples of E2E testing. Examples that start with `test_` or end with `_test.py`/`_tests.py` run with `pytest`. Other examples run directly with raw `python` (those generally start with `raw_` to avoid confusion).
<h3>🧪 Comprehensive E2E Testing with <code>pytest</code>:</h3>
202
165
203
166
<palign="left"><b>📝 <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py"target="_blank">This example</a> tests an e-commerce site with <code>pytest</code>:</b></p>
🥷 For stealth with `pytest`, add `--uc` as a command-line option.
195
+
231
196
--------
232
197
233
198
<palign="left"><b>📝 <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py"target="_blank">This example</a> tests another e-commerce site with <code>pytest</code>:</b></p>
@@ -254,7 +219,7 @@ pytest test_demo_site.py
254
219
255
220
> Easy to type, click, select, toggle, drag & drop, and more.
256
221
257
-
(For more examples, see the <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">SeleniumBase/examples/</a> folder.)
222
+
📚 For more examples, see the <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">SeleniumBase/examples/</a> folder.
0 commit comments