Skip to content

Commit c4b9192

Browse files
committed
Update the docs
1 parent 8b3c344 commit c4b9192

2 files changed

Lines changed: 26 additions & 22 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
<h1>SeleniumBase</h1>
1111

12-
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="350" /></a></p>
12+
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="400" /></a></p>
1313

14-
<h3 align="center" class="hero__title"><b>Stealthy automation and testing for the modern web.<br /></b></h3>
14+
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
1515

1616
<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></p>
1717
<p align="center"><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://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/SeleniumBase?style=social"></a> <a href="https://pepy.tech/projects/seleniumbase?timeRange=threeMonths&category=version&includeCIDownloads=true&granularity=daily&viewType=line&versions=*" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/discord/727927627830001734?color=7289DA&label=Discord&logo=discord&logoColor=white"/></a></p>
@@ -52,15 +52,15 @@
5252
<br />
5353
</p>
5454

55-
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><b translate="no">SeleniumBase</b></a> is an all-in-one Python framework designed to make browser automation, scraping, and testing significantly easier than using standard Selenium. With stealth options (eg. <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b translate="no">CDP Mode</b></a>) you'll avoid the usual restrictions imposed by websites with bot-detection. Includes a feature that <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md"><b>makes <span translate="no">Playwright</span> stealthy</b>.</p>
55+
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><b translate="no">SeleniumBase</b></a> is an all-in-one Python framework for making browser automation, scraping, and testing significantly easier. Stealth options (like <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b translate="no">CDP Mode</b></a>) let you avoid bot-detection. Includes <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md"><b><span translate="no">Stealthy Playwright Mode</span></b>.</p>
5656

5757
--------
5858

5959
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
6060

6161
🐙 Stealth modes: <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b></a> and <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> can bypass bot-detection, solve CAPTCHAs, and call advanced methods from the <a href="https://chromedevtools.github.io/devtools-protocol/" translate="no">Chrome Devtools Protocol</a>.
6262

63-
ℹ️ Many examples run with raw <code translate="no"><b>python</b></code>, although some <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> expect <a href="https://docs.pytest.org/en/latest/how-to/usage.html" translate="no"><b>pytest</b></a> (a Python unit-testing framework included with SeleniumBase that can discover, collect, and run tests automatically).
63+
ℹ️ Some <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> use <a href="https://docs.pytest.org/en/latest/how-to/usage.html" translate="no"><b>pytest</b></a> (a Python unit-testing framework included with SeleniumBase that can discover, collect, and run tests automatically).
6464

6565
--------
6666

examples/cdp_mode/ReadMe.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
🐙 <b translate="no">SeleniumBase</b> <b translate="no">CDP Mode</b> is a stealth mode that uses the <a href="https://chromedevtools.github.io/devtools-protocol/" translate="no">Chrome Devtools Protocol</a> (via <a href="https://github.com/mdmintz/MyCDP" translate="no"><span translate="no">MyCDP</span></a>) to control the web browser. <b translate="no">CDP Mode</b> can be used as a subset of <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md" translate="no"><span translate="no">UC Mode</span></a></b>, or via <b><a href="#Pure_CDP_Mode" translate="no">Pure CDP Mode</a></b>, which has sync and async formats. From CDP Mode, you can make Playwright stealthy (<a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/playwright/ReadMe.md">Stealthy Playwright Mode</a>).
66

7-
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="572" alt="High-Level Stealthy Architecture Overview" title="High-Level Stealthy Architecture Overview" />
7+
----
88

9-
--------
9+
⚙️ This diagram shows the stealthy architecture with <b>CDP Mode</b>:
10+
11+
<img src="https://seleniumbase.github.io/other/sb_stealth.png" width="585" alt="High-Level Stealthy Architecture Overview" title="High-Level Stealthy Architecture Overview" />
12+
13+
----
1014

1115
### 🎞️ YouTube tutorials that cover CDP Mode:
1216

@@ -15,17 +19,19 @@
1519

1620
(See `examples/cdp_mode/` for up-to-date examples.)
1721

18-
--------
22+
----
1923

2024
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=vt2zsdiNh3U"><img src="https://github.com/user-attachments/assets/82ab2715-727e-4d09-9314-b8905795dc43" title="SeleniumBase on YouTube" width="320" /></a>
2125
<p>(<b><a href="https://www.youtube.com/watch?v=vt2zsdiNh3U">Watch "Hacking websites with CDP" on YouTube! ▶️</a></b>)</p>
2226

23-
--------
27+
----
2428

2529
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ"><img src="https://github.com/user-attachments/assets/656977e1-5d66-4d1c-9eec-0aaa41f6522f" title="SeleniumBase on YouTube" width="320" /></a>
2630
<p>(<b><a href="https://www.youtube.com/watch?v=gEZhTfaIxHQ">Watch "Web-Scraping with GitHub Actions" on YouTube! ▶️</a></b>)</p>
2731

28-
--------
32+
----
33+
34+
ℹ️ Note the differences between <b>UC Mode</b> and <b>CDP Mode</b>:
2935

3036
👤 <b translate="no">UC Mode</b>'s stealth is based on a modified chromedriver (<code>uc_driver</code>) that avoids bot-detection by disconnecting and reconnecting WebDriver from the browser at strategic times. Due to advancements in anti-bot technology, more stealth was needed to bypass advanced bot-detection. (That's where <b translate="no">CDP Mode</b> comes in.)
3137

@@ -38,14 +44,12 @@
3844
* Full access to call any advanced CDP library method.
3945
* Can be used to make the Playwright library stealthy.
4046

41-
--------
47+
----
4248

43-
### 🐙 <b translate="no">CDP Mode</b> Usage:
49+
### 🐙 <b translate="no">CDP Mode</b> Usage (when used as a subset of UC Mode):
4450

4551
* **`sb.activate_cdp_mode(url)`**
4652

47-
> (Call that from a **UC Mode** script)
48-
4953
That disconnects WebDriver from Chrome (which prevents detection), and gives you access to `sb.cdp` methods (which don't trigger anti-bot checks).
5054

5155
> (**New:** Calling **`sb.open(url)`** from UC Mode also activates CDP Mode now.)
@@ -67,7 +71,7 @@ with SB(uc=True, test=True, locale="en") as sb:
6771

6872
(If the CAPTCHA wasn't bypassed automatically when going to the URL, then `sb.solve_captcha()` gets the job done.)
6973

70-
--------
74+
----
7175

7276
Here's another example that calls `sb.solve_captcha()`:
7377
([SeleniumBase/examples/cdp_mode/raw_planetmc.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_planetmc.py))
@@ -88,13 +92,13 @@ with SB(uc=True, test=True, guest=True) as sb:
8892

8993
In many cases, the CAPTCHA will be solved automatically without needing to call `solve_captcha()`.
9094

91-
--------
95+
----
9296

9397
You can also use `PyAutoGUI` to click on elements with the mouse by calling `sb.cdp.gui_click_element(selector)`.
9498

9599
ℹ️ Note that `PyAutoGUI` is an optional dependency. If calling a method that uses it when not already installed, then `SeleniumBase` installs `PyAutoGUI` at runtime.
96100

97-
--------
101+
----
98102

99103
### 🐙 Here are a few common `sb.cdp` methods:
100104

@@ -127,7 +131,7 @@ To find out if WebDriver is connected or disconnected, call:
127131

128132
<b>Note:</b> When <b translate="no">CDP Mode</b> is initialized from <b translate="no">UC Mode</b>, the WebDriver is disconnected from the browser. (The stealthy <b translate="no">CDP-Driver</b> takes over.)
129133

130-
--------
134+
----
131135

132136
### 🐙 <b translate="no">CDP Mode</b> examples ([SeleniumBase/examples/cdp_mode](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/cdp_mode))
133137

@@ -371,7 +375,7 @@ with SB(uc=True, test=True, locale="en", pls="none") as sb:
371375

372376
(<b>Note:</b> Some sites may IP-block you for 36 hours or more if they catch you using regular <span translate="no">Selenium WebDriver</span>. Be extra careful when creating and/or modifying automation scripts that run on them.)
373377

374-
--------
378+
----
375379

376380
### 🐙 <b translate="no">CDP Mode</b> API / Methods
377381

@@ -571,7 +575,7 @@ sb.cdp.save_as_pdf(name, folder=None)
571575

572576
ℹ️ When available, calling `sb.METHOD()` redirects to `sb.cdp.METHOD()` when CDP Mode is active. From Pure CDP Mode, always call these methods with `sb.METHOD()` instead of `sb.cdp.METHOD()`.
573577

574-
--------
578+
----
575579

576580
<a id="Pure_CDP_Mode"></a>
577581

@@ -625,7 +629,7 @@ sb.driver.stop()
625629

626630
ℹ️ Even if you don't call `sb.driver.stop()`, the browser still quits after the script goes out-of-scope.
627631

628-
--------
632+
----
629633

630634
### 🐙 <b translate="no">CDP Mode</b> Async API / Methods
631635

@@ -710,7 +714,7 @@ await tab.get_local_storage()
710714
await tab.set_local_storage(items)
711715
```
712716

713-
--------
717+
----
714718

715719
### 🐙 <b translate="no">CDP Mode</b> WebElement API / Methods
716720

@@ -750,7 +754,7 @@ element.get_attribute(attribute)
750754
element.get_parent()
751755
```
752756

753-
--------
757+
----
754758

755759
<img src="https://seleniumbase.github.io/cdn/img/sb_text_f.png" alt="SeleniumBase" title="SeleniumBase" align="center" width="335">
756760

0 commit comments

Comments
 (0)