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
<p>(<b><ahref="https://www.youtube.com/watch?v=-EpZlhGWo9k">Watch the 3rd UC Mode tutorial on YouTube! ▶️</a></b>)</p>
2658
+
2655
2659
<hr/>
2656
2660
<p>👤 <btranslate="no">UC Mode</b> is based on <ahref="https://github.com/ultrafunkamsterdam/undetected-chromedriver">undetected-chromedriver</a>, but includes multiple updates, fixes, and improvements, such as:</p>
2657
2661
<ul>
@@ -2703,6 +2707,7 @@ <h2 id="uc-mode"><a href="https://github.com/seleniumbase/SeleniumBase/"><img sr
<p>If running on a Linux server, <code>uc_gui_handle_captcha()</code> might not be good enough. Switch to <code>uc_gui_click_captcha()</code> to be more stealthy. Note that these methods auto-detect between CF Turnstile and Google reCAPTCHA.</p>
2710
+
<p>Sometimes you need to add <code>incognito=True</code> with <code>uc=True</code> to maximize your anti-detection abilities. (Some websites can detect you if you don't do that.)</p>
2706
2711
<p>👤 Here's an example <b>where the CAPTCHA appears after submitting a form</b>:</p>
<p>(Note that while the special <b><codetranslate="no">UC Mode</code></b> breakpoint is active, you can't use <b><codetranslate="no">Selenium</code></b> commands in the browser, and the browser can't detect <b><codetranslate="no">Selenium</code></b>.)</p>
2826
-
<p>👤 On Linux, you may need to use <code>driver.uc_gui_click_captcha()</code> to successfully bypass a Cloudflare CAPTCHA. If there's more than one Cloudflare iframe on that website, then put the CSS Selector of an element that's above the iframe as the first arg to <code>driver.uc_gui_click_captcha()</code>. This method uses <code>pyautogui</code>. In order for <code>pyautogui</code> to focus on the correct element, use <code>xvfb=True</code> / <code>--xvfb</code> to activate a special virtual display on Linux.</p>
2827
-
<p>👤 <code>driver.uc_gui_click_captcha()</code> auto-detects the CAPTCHA type before trying to click it. This is a generic method for both CF Turnstile and Google reCAPTCHA. It will use the code from <code>uc_gui_click_cf()</code> and <code>uc_gui_click_rc()</code> as needed.</p>
2828
-
<p>👤 <code>driver.uc_gui_click_cf(frame="iframe", retry=False, blind=False)</code> has three args. (All optional). The first one, <code>frame</code>, lets you specify the iframe in case the CAPTCHA is not located in the first iframe on the page. The second one, <code>retry</code>, lets you retry the click after reloading the page if the first one didn't work (and a CAPTCHA is still present after the page reload). The third arg, <code>blind</code>, will retry after a page reload (if the first click failed) by clicking at the last known coordinates of the CAPTCHA checkbox without confirming first with Selenium that a CAPTCHA is still on the page.</p>
2829
-
<p>👤 <code>driver.uc_gui_click_rc(frame="iframe", retry=False, blind=False)</code> is for reCAPTCHA. This may only work a few times before not working anymore... not because Selenium was detected, but because reCAPTCHA uses advanced AI to detect unusual activity, unlike the CF Turnstile, which only uses basic detection.</p>
2831
+
<p>👤 On Linux, you may need to use <code>uc_gui_click_captcha()</code> to successfully bypass a Cloudflare CAPTCHA. If there's more than one Cloudflare iframe on that website, then put the CSS Selector of an element that's above the iframe as the first arg to <code>uc_gui_click_captcha()</code>. This method uses <code>pyautogui</code>. In order for <code>pyautogui</code> to focus on the correct element, use <code>xvfb=True</code> / <code>--xvfb</code> to activate a special virtual display on Linux.</p>
2832
+
<p>👤 <code>uc_gui_click_captcha()</code> auto-detects the CAPTCHA type before trying to click it. This is a generic method for both CF Turnstile and Google reCAPTCHA. It will use the code from <code>uc_gui_click_cf()</code> and <code>uc_gui_click_rc()</code> as needed.</p>
2833
+
<p>👤 <code>uc_gui_click_cf(frame="iframe", retry=False, blind=False)</code> has three args. (All optional). The first one, <code>frame</code>, lets you specify the selector above the iframe in case the CAPTCHA is not located in the first iframe on the page. The second one, <code>retry</code>, lets you retry the click after reloading the page if the first one didn't work (and a CAPTCHA is still present after the page reload). The third arg, <code>blind</code>, (if <code>True</code>), will retry after a page reload (if the first click failed) by clicking at the last known coordinates of the CAPTCHA checkbox without confirming first with Selenium that a CAPTCHA is still on the page.</p>
2834
+
<p>👤 <code>uc_gui_click_rc(frame="iframe", retry=False, blind=False)</code> is for reCAPTCHA. This may only work a few times before not working anymore... not because Selenium was detected, but because reCAPTCHA uses advanced AI to detect unusual activity, unlike the CF Turnstile, which only uses basic detection.</p>
2830
2835
<p>👤 To find out if <btranslate="no">UC Mode</b> will work at all on a specific site (before adjusting for timing), load your site with the following script:</p>
<p>(If you remain undetected while loading the page and performing manual actions, then you know you can create a working script once you swap the breakpoint with a time and add special methods like <b><codetranslate="no">driver.uc_click</code></b> as needed.)</p>
2841
+
<p>(If you remain undetected while loading the page and performing manual actions, then you know you can create a working script once you swap the breakpoint with a time and add special methods like <b><codetranslate="no">sb.uc_click</code></b> as needed.)</p>
2837
2842
<p>👤 <b>Multithreaded UC Mode:</b></p>
2838
2843
<p>If you're using <b><codetranslate="no">pytest</code></b> for multithreaded <btranslate="no">UC Mode</b> (which requires using one of the <b><codetranslate="no">pytest</code></b><ahref="../syntax_formats/">syntax formats</a>), then all you have to do is set the number of threads when your script runs. (<code>-n NUM</code>) Eg:</p>
<p>Avoiding detection while clicking is easy if you schedule your clicks to happen at a future point when the <b><codetranslate="no">chromedriver</code></b> service has been stopped. Here's a JS command that lets you schedule events (such as clicks) to happen in the future:</p>
<p>The above JS method is used within the <b><codetranslate="no">SeleniumBase</code></b><btranslate="no">UC Mode</b> method: <b><codetranslate="no">driver.uc_click(selector)</code></b> so that clicking can be done in a stealthy way. <btranslate="no">UC Mode</b> schedules your click, disconnects <b><codetranslate="no">chromedriver</code></b> from <btranslate="no">Chrome</b>, waits a little (customizable), and reconnects.</p>
2897
+
<p>The above JS method is used within the <b><codetranslate="no">SeleniumBase</code></b><btranslate="no">UC Mode</b> method: <b><codetranslate="no">sb.uc_click(selector)</code></b> so that clicking can be done in a stealthy way. <btranslate="no">UC Mode</b> schedules your click, disconnects <b><codetranslate="no">chromedriver</code></b> from <btranslate="no">Chrome</b>, waits a little (customizable), and reconnects.</p>
2893
2898
<hr/>
2894
2899
<p>🏆 <b>Choosing the right CAPTCHA service</b> for your business / website:</p>
0 commit comments