0

I'm using Playwright and I'm trying to automatically navigate to a web page, but I don't see the Chrome notification "Chrome is being controlled by automated testing software" every time I run the program. How do I enable this notification?

Python code:

from playwright.sync_api import Playwright, sync_playwright

with sync_playwright() as playwright:
    # Define Chrome browser options
    options = {
        'args': [
            '--disable-gpu',
            '--disable-dev-shm-usage',
            '--disable-setuid-sandbox',
            '--no-first-run',
            '--no-sandbox',
            '--no-zygote',
            '--ignore-certificate-errors',
            '--disable-extensions',
            '--disable-infobars',
            '--disable-notifications',
            '--disable-popup-blocking',
            '--remote-debugging-port=9222'
        ],
        'headless': False  # Set headless option here
    }

    # Launch Chrome browser with options
    browser = playwright.chromium.launch(**options)
    
    # Create a new context
    context = browser.new_context()
    
    # Create a new page
    page = context.new_page()

I want it to be like below picture:

enter image description here

Anik Saha
  • 97
  • 6

0 Answers0