-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add UC Mode clicking methods that use PyAutoGUI #2911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac3a9be
Add UC Mode clicking methods
mdmintz 4dcbf3c
Add more methods to SB
mdmintz de75ec6
Update examples
mdmintz afcd439
Update the documentation
mdmintz 5a06b39
Refresh Python dependencies
mdmintz 120b1ae
Version 4.28.4
mdmintz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
examples/raw_gui_click.py
This file contains hidden or 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!") |
11 changes: 7 additions & 4 deletions
examples/raw_order_tickets.py
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
seleniumbase/__version__.py
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.