Skip to content
Discussion options

You must be logged in to vote

Looks like you're trying to do a Google search. There's an example of that here:
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py

from seleniumbase import SB

with SB(uc=True, test=True) as sb:
    url = "https://google.com/ncr"
    sb.activate_cdp_mode(url)
    sb.type('[title="Search"]', "SeleniumBase GitHub page")
    sb.click("div:not([jsname]) > * > input")
    sb.sleep(2)
    print(sb.get_page_title())
    sb.sleep(1)  # Wait for the "AI Overview" result
    if sb.is_text_visible("Generating"):
        sb.wait_for_text("AI Overview")
    sb.save_as_pdf_to_logs()  # Saved to ./latest_logs/
    sb.save_page_source_to_logs()
    sb.save_screenshot_to_logs()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants