-
Notifications
You must be signed in to change notification settings - Fork 979
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2911 from seleniumbase/add_uc_mode_clicking_methods
Add UC Mode clicking methods that use PyAutoGUI
- Loading branch information
Showing
11 changed files
with
291 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
UC Mode now has uc_gui_click_cf(), which uses PyAutoGUI. | ||
An incomplete UserAgent is used to force CAPTCHA-solving. | ||
""" | ||
import sys | ||
from seleniumbase import SB | ||
|
||
agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/126.0.0.0" | ||
if "linux" in sys.platform: | ||
agent = None # Use the default UserAgent | ||
|
||
with SB(uc=True, test=True, rtf=True, agent=agent) as sb: | ||
url = "https://www.virtualmanager.com/en/login" | ||
sb.uc_open_with_reconnect(url, 4) | ||
sb.uc_gui_click_cf() # Ready if needed! | ||
sb.assert_element('input[name*="email"]') | ||
sb.assert_element('input[name*="login"]') | ||
sb.set_messenger_theme(location="bottom_center") | ||
sb.post_message("SeleniumBase wasn't detected!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from seleniumbase import SB | ||
|
||
with SB(uc=True, test=True, ad_block_on=True) as sb: | ||
with SB(uc=True, test=True, ad_block=True) as sb: | ||
url = "https://www.thaiticketmajor.com/concert/" | ||
sb.driver.uc_open_with_reconnect(url, 6.111) | ||
sb.driver.uc_click("button.btn-signin", 4.1) | ||
sb.uc_open_with_reconnect(url, 6.111) | ||
sb.uc_click("button.btn-signin", 4.1) | ||
sb.switch_to_frame('iframe[title*="Cloudflare"]') | ||
sb.assert_element("div#success svg#success-icon") | ||
if not sb.is_element_visible("svg#success-icon"): | ||
sb.uc_gui_handle_cf() | ||
sb.switch_to_frame('iframe[title*="Cloudflare"]') | ||
sb.assert_element("svg#success-icon") | ||
sb.switch_to_default_content() | ||
sb.set_messenger_theme(location="top_center") | ||
sb.post_message("SeleniumBase wasn't detected!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# seleniumbase package | ||
__version__ = "4.28.3" | ||
__version__ = "4.28.4" |
Oops, something went wrong.