Skip to content

Commit 7069276

Browse files
committed
Update examples
1 parent b83c618 commit 7069276

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

examples/cdp_mode/raw_cf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""Using CDP Mode with PyAutoGUI to bypass CAPTCHAs."""
22
from seleniumbase import SB
33

4-
with SB(uc=True, test=True, locale_code="en") as sb:
4+
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
55
url = "https://www.cloudflare.com/login"
66
sb.activate_cdp_mode(url)
77
sb.sleep(3)
88
sb.uc_gui_handle_captcha() # PyAutoGUI press Tab and Spacebar
99
sb.sleep(2)
1010

11-
with SB(uc=True, test=True, locale_code="en") as sb:
11+
with SB(uc=True, test=True, locale_code="en", incognito=True) as sb:
1212
url = "https://www.cloudflare.com/login"
1313
sb.activate_cdp_mode(url)
1414
sb.sleep(2)

examples/cdp_mode/raw_elal.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
print("*** Lowest Price: ***")
2727
lowest_price = sorted(prices)[0]
2828
print(lowest_price)
29+
sb.cdp.scroll_down(12)
30+
sb.sleep(1)
2931
sb.cdp.find_element_by_text(lowest_price).click()
3032
sb.sleep(1)
3133
search_cell = 'button[aria-label*="Search.cell.buttonTitle"]'

examples/test_usefixtures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
@pytest.mark.usefixtures("sb")
55
class Test_UseFixtures:
66
def test_usefixtures_on_class(self):
7+
if not hasattr(self, "sb"):
8+
print("This test is for pytest only!")
9+
return
710
sb = self.sb
811
sb.open("https://seleniumbase.io/realworld/login")
912
sb.type("#username", "demo_user")

0 commit comments

Comments
 (0)