-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #3304 from seleniumbase/cdp-mode-patch-15
CDP Mode - Patch 15
- Loading branch information
Showing
11 changed files
with
194 additions
and
127 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
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,12 @@ | ||
from seleniumbase import SB | ||
|
||
with SB(uc=True, test=True, incognito=True) as sb: | ||
url = "https://demo.fingerprint.com/playground" | ||
sb.activate_cdp_mode(url) | ||
sb.sleep(1) | ||
sb.cdp.highlight('a[href*="browser-bot-detection"]') | ||
bot_row_selector = 'table:contains("Bot") tr:nth-of-type(3)' | ||
print(sb.cdp.get_text(bot_row_selector)) | ||
sb.cdp.assert_text("Bot Not detected", bot_row_selector) | ||
sb.cdp.highlight(bot_row_selector) | ||
sb.sleep(2) |
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 @@ | ||
"""To handle alerts in CDP Mode, reconnect and use WebDriver.""" | ||
from seleniumbase import SB | ||
|
||
with SB(uc=True, test=True) as sb: | ||
url = "https://the-internet.herokuapp.com/javascript_alerts" | ||
sb.activate_cdp_mode(url) | ||
sb.reconnect() | ||
sb.cdp.gui_click_element('button[onclick="jsAlert()"]') | ||
sb.sleep(1) | ||
sb.accept_alert() | ||
sb.sleep(1) | ||
sb.cdp.gui_click_element('button[onclick="jsConfirm()"]') | ||
sb.sleep(1) | ||
sb.dismiss_alert() | ||
sb.sleep(1) | ||
sb.cdp.gui_click_element('button[onclick="jsPrompt()"]') | ||
sb.sleep(1) | ||
sb.uc_gui_write("Here is my prompt answer\n") | ||
sb.sleep(1) |
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.33.1" | ||
__version__ = "4.33.2" |
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
Oops, something went wrong.