Мне нужно запустить только локальный браузер, но при старте запускаются 2 окна.
from playwright.sync_api import sync_playwright
def run():
with sync_playwright() as p:
browser = p.firefox.launch_persistent_context(
user_data_dir="C:\\Users\\cocain\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\bot_new",
headless=False,
slow_mo=50,
args=["--no-sandbox"],
)
page = browser.new_page()
page.set_viewport_size({"width": 800, "height": 600})
def navigate():
"""Navigate in browser"""
page.goto("https://example.com")
navigate()
if __name__ == "__main__":
run()