Skip to content

Commit 876dead

Browse files
committed
Update the docs
1 parent 16a61be commit 876dead

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/cdp_mode/playwright/ReadMe/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3034,7 +3034,8 @@ <h3 id="stealthy-playwright-mode-details">🎭 <b translate="no">Stealthy Playwr
30343034
<p>The <code>sb_cdp</code> and <code>cdp_driver</code> formats don't use WebDriver at all, meaning that <code>chromedriver</code> isn't needed. From these two formats, Stealthy Playwright Mode can call <a href="../../../../help_docs/cdp_mode_methods/">CDP Mode methods</a> and Playwright methods.</p>
30353035
<p>The <code>SB()</code> format requires WebDriver, therefore <code>chromedriver</code> will be downloaded (as <code>uc_driver</code>) if the driver isn't already present on the local machine. The <code>SB()</code> format has access to Selenium WebDriver methods via <a href="../../../../help_docs/method_summary/">the SeleniumBase API</a>. Using Stealthy Playwright Mode from <code>SB()</code> grants access to all the APIs: Selenium, SeleniumBase, <a href="../../../../help_docs/uc_mode/">UC Mode</a>, <a href="../../ReadMe/">CDP Mode</a>, and Playwright.</p>
30363036
<p>In the sync formats, <code>get_endpoint_url()</code> also applies <code>nest-asyncio</code> so that nested event loops are allowed. (Python doesn't allow nested event loops by default). Without this, you'd get the error: <code>"Cannot run the event loop while another loop is running"</code> when calling CDP Mode methods (such as <code>solve_captcha()</code>) from within the Playwright context manager. This <code>nest-asyncio</code> call is done behind-the-scenes so that users don't need to handle this on their own.</p>
3037-
<p>Default timeout values are different between Playwright and SeleniumBase. For instance, a 30-second default timeout in a Playwright method might be 10 seconds in the equivalent SeleniumBase method. When specifying custom timeout values, Playwright uses milliseconds, whereas SeleniumBase uses seconds. Eg. <code>page.wait_for_timeout(500)</code> is the equivalent of <code>sb.sleep(0.5)</code>.</p>
3037+
<p>Default timeout values are different between Playwright and SeleniumBase. For instance, a 30-second default timeout in a Playwright method might only be 10 seconds in the equivalent SeleniumBase method.</p>
3038+
<p>When specifying custom timeout values, Playwright uses milliseconds, whereas SeleniumBase uses seconds. Eg. <code>page.wait_for_timeout(2000)</code> is the equivalent of <code>sb.sleep(2)</code>. Although adding random sleeps to a script is generally discouraged, it helps the automation look more human-like for stealth, and it can prevent exceeding rate limits that trigger a block when automation performs actions too quickly.</p>
30383039
<p>Playwright's <code>:has-text()</code> selector is the equivalent of SeleniumBase's <code>:contains()</code> selector, except for one small difference: <code>:has-text()</code> isn't case-sensitive, but <code>:contains()</code> is.</p>
30393040
<p>Unlike normal Playwright, you don't need to run <code>playwright install</code> before running Stealthy Playwright Mode scripts because the system Chrome will be used. There's also the option of setting <code>use_chromium=True</code> to use the unbranded Chromium browser instead, which still supports extensions.</p>
30403041
<h3 id="stealthy-playwright-mode-examples">🎭 <b translate="no">Stealthy Playwright Mode</b> examples<a class="headerlink" href="#stealthy-playwright-mode-examples" title="Permanent link">&para;</a></h3>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)