Skip to content

Commit fe3b985

Browse files
committed
Update the docs
1 parent 2f8a8d7 commit fe3b985

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

help_docs/method_summary.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,44 @@ self._print(TEXT) # Calls Python's print() / Allows for translations
970970

971971
############
972972

973+
# **** UC Mode methods. (uc=True / --uc) ****
974+
975+
# (Mainly for CDP Mode) - (For all CDP methods, see the CDP Mode Docs)
976+
977+
self.activate_cdp_mode(url=None) # Activate CDP Mode on the given URL
978+
979+
self.reconnect(timeout=0.1) # disconnect() + sleep(timeout) + connect()
980+
981+
self.disconnect() # Stops the webdriver service to prevent detection
982+
983+
self.connect() # Starts the webdriver service to allow actions again
984+
985+
# (For regular UC Mode)
986+
987+
self.uc_open(url) # (Open in same tab with default reconnect_time)
988+
989+
self.uc_open_with_tab(url) # (New tab with default reconnect_time)
990+
991+
self.uc_open_with_reconnect(url, reconnect_time=None) # (New tab)
992+
993+
self.uc_open_with_disconnect(url, timeout=None) # New tab + sleep()
994+
995+
self.uc_click(selector) # A stealthy click for evading bot-detection
996+
997+
self.uc_gui_press_key(key) # Use PyAutoGUI to press the keyboard key
998+
999+
self.uc_gui_press_keys(keys) # Use PyAutoGUI to press a list of keys
1000+
1001+
self.uc_gui_write(text) # Similar to uc_gui_press_keys(), but faster
1002+
1003+
self.uc_gui_click_x_y(x, y, timeframe=0.25) # PyAutoGUI click screen
1004+
1005+
self.uc_gui_click_captcha(frame="iframe", retry=False, blind=False)
1006+
1007+
self.uc_gui_handle_captcha(frame="iframe")
1008+
1009+
############
1010+
9731011
# "driver"-specific methods added (or modified) by SeleniumBase
9741012

9751013
driver.default_get(url) # Because driver.get(url) works differently in UC Mode
@@ -1076,7 +1114,9 @@ driver.uc_open_with_reconnect(url, reconnect_time=None) # (New tab)
10761114

10771115
driver.uc_open_with_disconnect(url, timeout=None) # New tab + sleep()
10781116

1079-
driver.reconnect(timeout) # disconnect() + sleep(timeout) + connect()
1117+
driver.uc_activate_cdp_mode(url=None) # Activate CDP Mode on the given URL
1118+
1119+
driver.reconnect(timeout=0.1) # disconnect() + sleep(timeout) + connect()
10801120

10811121
driver.disconnect() # Stops the webdriver service to prevent detection
10821122

@@ -1093,12 +1133,8 @@ driver.uc_gui_write(text) # Similar to uc_gui_press_keys(), but faster
10931133
driver.uc_gui_click_x_y(x, y, timeframe=0.25) # PyAutoGUI click screen
10941134

10951135
driver.uc_gui_click_captcha(frame="iframe", retry=False, blind=False)
1096-
# driver.uc_gui_click_cf(frame="iframe", retry=False, blind=False)
1097-
# driver.uc_gui_click_rc(frame="iframe", retry=False, blind=False)
10981136

1099-
driver.uc_gui_handle_captcha(frame="iframe") # (Auto-detects the CAPTCHA)
1100-
# driver.uc_gui_handle_cf(frame="iframe") # PyAutoGUI click CF Turnstile
1101-
# driver.uc_gui_handle_rc(frame="iframe") # PyAutoGUI click G. reCAPTCHA
1137+
driver.uc_gui_handle_captcha(frame="iframe")
11021138
```
11031139

11041140
--------

help_docs/recorder_mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ sbase print ./recordings/TEST_NAME_rec.py -n
7575
cp ./recordings/TEST_NAME_rec.py ./TEST_NAME.py
7676
```
7777
78-
The first command creates a boilerplate test with a breakpoint; the second command runs the test with the Recorder activated; the third command prints the completed test to the console; and the fourth command replaces the initial boilerplate with the completed test. If you're just experimenting with the Recorder, you can run the second command as many times as you want, and it'll override previous recordings saved to ``./recordings/TEST_NAME_rec.py``. (Note that ``-s`` is needed to allow breakpoints, unless you already have a ``pytest.ini`` file present with ``addopts = --capture=no`` in it. The ``-q`` is optional, which shortens ``pytest`` console output.)
78+
The first command creates a boilerplate test with a breakpoint; the second command runs the test with the Recorder activated; the third command prints the completed test to the console; and the fourth command replaces the initial boilerplate with the completed test. If you're just experimenting with the Recorder, you can run the second command as many times as you want, and it'll override previous recordings saved to ``./recordings/TEST_NAME_rec.py``. (Note that ``-s`` is needed to allow breakpoints, unless you already have a ``pytest.ini`` file present where you set it. The ``-q`` is optional, which shortens ``pytest`` console output.)
7979
8080
⏺️ You can also use the Recorder to add code to an existing test. To do that, you'll first need to create a breakpoint in your code to insert manual browser actions:
8181

0 commit comments

Comments
 (0)