Skip to content

Instantly share code, notes, and snippets.

@mkwatson
Created November 10, 2022 14:21
Show Gist options
  • Save mkwatson/9c6e3f47c44ce6da53ce8989185cbec5 to your computer and use it in GitHub Desktop.
Save mkwatson/9c6e3f47c44ce6da53ce8989185cbec5 to your computer and use it in GitHub Desktop.
from playwright.sync_api import Playwright, sync_playwright, expect
def run(playwright: Playwright) -> None:
browser = playwright.chromium.launch(headless=False)
context = browser.new_context()
page = context.new_page()
page.goto("https://www.nba.com/warriors/tickets/dub-nation-deals-activate-your-offer")
page.get_by_role("button", name="» View Current Offer").click()
page.wait_for_url("https://www.nba.com/warriors/tickets/dub-nation-deals-activate-your-offer?fevoUri=dub-nation-deals-b5a6e0b%2F")
page.frame_locator("#fevo-purchase-flow-frame").get_by_text("No results found. Please try again.").click()
# ---------------------
context.close()
browser.close()
with sync_playwright() as playwright:
run(playwright)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment