async def main(): async with async_playwright() as p: browser = await p.chromium.launch_persistent_context( user_data_dir=USER_DATA_DIR, headless=True, executable_path=r"C:\Program Files\Google\Chrome\Application\chrome.exe", args=[ "--start-maximized", "--disable-notifications", "--disable-infobars", "--no-default-browser-check", "--disable-blink-features=AutomationControlled", "--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36", "--no-sandbox", "--disable-setuid-sandbox" ] ) These flags for chrome.exe do not work; it does not start maximised and the viewport seems to be capped. You can see what it looks in the screenshot below. Googling did not help, although they mentioned about playwright having problems with flags. Any help appreciated, thanks! Continue reading...