Skip to content

Commit a56253c

Browse files
committed
Update examples
1 parent b694e46 commit a56253c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/cdp_mode/raw_mouser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
sb.press_keys('input[name="keyword"]', "FLUKE-TC01B 25HZ")
88
sb.click('button[type="submit"]')
99
sb.sleep(2)
10-
print(sb.get_text("h1"))
11-
print(sb.get_text("span#spnDescription"))
12-
print(sb.get_text("td.ext-price-col"))
1310
sb.highlight("h1")
1411
sb.highlight("span#spnDescription")
1512
sb.highlight("td.ext-price-col")
13+
print(sb.get_text("h1"))
14+
print(sb.get_text("span#spnDescription"))
15+
print(sb.get_text("td.ext-price-col"))

examples/hack_the_planet.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ def test_all_your_base_are_belong_to_us(self):
9191
self.open("https://dev.to/top/infinity")
9292
self.click_if_visible('button[aria-label="Close campaign banner"]')
9393
self.click_if_visible('svg[aria-label="Close campaign banner"]')
94-
try:
94+
self.click_if_visible('button[id*="sponsorship-close-trigger"]')
95+
if self.is_element_visible('main div:contains("Pinned")'):
9596
self.hide_elements('main div:contains("Pinned")')
96-
except Exception:
97-
pass
97+
if self.is_element_visible('[data-type-of="in_house"]'):
98+
self.hide_elements('[data-type-of="in_house"]')
9899
self.set_text_content('nav a[data-text="Relevant"]', "ALL")
99100
self.set_text_content('nav a[data-text="Latest"]', "YOUR")
100101
self.set_text_content('nav a[data-text="Top"]', "BASE")
@@ -124,8 +125,6 @@ def test_all_your_base_are_belong_to_us(self):
124125
self.highlight('nav a[data-text="Month"]', loops=1, scroll=False)
125126
self.highlight('nav a[data-text="Year"]', loops=1, scroll=False)
126127
self.highlight('nav a[data-text="Infinity"]', loops=3, scroll=False)
127-
if self.is_element_visible('h2 a[href*="simonh"]'):
128-
self.highlight('h2 a[href*="simonh"]', loops=7, scroll=False)
129128
if self.is_element_visible('main h2 a[id*="article"]'):
130129
self.highlight('main h2 a[id*="article"]', loops=7, scroll=False)
131130
self.highlight("section.crayons-card", loops=7, scroll=False)

examples/raw_google.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
with SB(test=True, uc=True) as sb:
44
sb.open("https://google.com/ncr")
55
sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
6+
sb.sleep(1)
67
sb.click('[href*="github.com/seleniumbase/"]')
78
sb.save_screenshot_to_logs() # ./latest_logs/
89
print(sb.get_page_title())

0 commit comments

Comments
 (0)