from playwright.sync_api import sync_playwright
url = "https://hls-js.netlify.app/demo/"
with sync_playwright() as p:
browser = p.chromium.launch(channel = "chrome")
page = browser.new_page()
page.on("response", lambda response: print(response.url) if (".m3u8" in response.url) else False)
page.goto(url)
page.wait_for_timeout(10*1000)
browser.close()
Hi guys, i need to pass the "response.url" inside a variable that I can use further in the code. I don't want response.url printed out, I just want to save that string in a variable. How can I do this?