Skip to content

Commit 8e72c04

Browse files
committed
Update the Google Search example
1 parent 41dd482 commit 8e72c04

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/raw_google.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
with SB(test=True, uc=True) as sb:
44
sb.open("https://google.com/ncr")
5-
sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
6-
sb.sleep(1)
7-
sb.click('[href*="github.com/seleniumbase/"]')
8-
sb.save_screenshot_to_logs() # ./latest_logs/
5+
sb.type('[title="Search"]', "SeleniumBase GitHub page")
6+
sb.click("div:not([jsname]) > * > input")
97
print(sb.get_page_title())
8+
sb.sleep(2) # Wait for the "AI Overview" result
9+
if sb.is_text_visible("Generating"):
10+
sb.wait_for_text("AI Overview")
11+
sb.save_as_pdf_to_logs() # Saved to ./latest_logs/
12+
sb.save_page_source_to_logs()
13+
sb.save_screenshot_to_logs()

0 commit comments

Comments
 (0)