File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed
Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 33with SB (uc = True , test = True ) as sb :
44 url = "https://google.com/ncr"
55 sb .activate_cdp_mode (url )
6- sb .type ('[title="Search "]' , "SeleniumBase GitHub page" )
7- sb .click ("div:not([jsname]) > * > input" )
8- sb .sleep (2 )
6+ sb .type ('[name="q "]' , "SeleniumBase GitHub page" )
7+ sb .click ('[value="Google Search"]' )
8+ sb .sleep (4 ) # The "AI Overview" sometimes loads
99 print (sb .get_page_title ())
10- sb .sleep (1 ) # Wait for the "AI Overview" result
11- if sb .is_text_visible ("Generating" ):
12- sb .wait_for_text ("AI Overview" )
13- sb .save_as_pdf_to_logs () # Saved to ./latest_logs/
10+ sb .save_as_pdf_to_logs ()
1411 sb .save_page_source_to_logs ()
1512 sb .save_screenshot_to_logs ()
13+ print ("Logs have been saved to: ./latest_logs/" )
Original file line number Diff line number Diff line change 44with SB (uc = True , test = True ) as sb :
55 sb .open ("https://google.com/ncr" )
66 sb .type ('[name="q"]' , "SeleniumBase on GitHub" )
7- sb .click ("div:not([jsname]) > * > input" )
7+ sb .click ('[value="Google Search"]' )
88 sb .highlight ('a[href*="github.com/seleniumbase"]' )
99 sb .sleep (0.5 )
1010
Original file line number Diff line number Diff line change 1313with SB(uc=True, test=True) as sb:
1414 url = "https://google.com/ncr"
1515 sb.activate_cdp_mode(url)
16- sb.type('[title="Search "]', "SeleniumBase GitHub page")
17- sb.click("div:not([jsname]) > * > input" )
16+ sb.type('[name="q "]', "SeleniumBase GitHub page")
17+ sb.click('[value="Google Search"]' )
1818 sb.sleep(2)
1919 print(sb.get_page_title())
2020```
@@ -148,8 +148,8 @@ def SB(
148148 with SB(uc=True, test=True) as sb:
149149 url = "https://google.com/ncr"
150150 sb.activate_cdp_mode(url)
151- sb.type('[title="Search "]', "SeleniumBase GitHub page")
152- sb.click("div:not([jsname]) > * > input" )
151+ sb.type('[name="q "]', "SeleniumBase GitHub page")
152+ sb.click('[value="Google Search"]' )
153153 sb.sleep(2)
154154 print(sb.get_page_title())
155155
You can’t perform that action at this time.
0 commit comments