I'm creating a web automation that I need to keep the browser open, but since playwright library only has the getting started showing the code including the "with" statement every time the script it's finished the browser close itself. I know I could quickly fix this with time(100), but this doesn't seem like the best practice. I've tried to create do something similar, without the with statement, but it keeps closing the browser. How can I fix this issue and keep the browser open?
Please see my code below:
from playwright.sync_api import sync_playwright
p = sync_playwright().start()
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto('https://www.google.com/')
p.stop()