[Python] How to suppress Chrome GCM DEPRECATED_ENDPOINT errors when running Selenium WebDriver?

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm running a web scraping project using Selenium with ChromeDriver in headless mode, and I'm constantly seeing the following logs in my terminal:

    [20376:708:0708/170807.138:ERROR:google_apis\gcm\engine\registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT [20376:708:0708/170937.002:ERROR:google_apis\gcm\engine\registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT WARNING: All log messages before absl::InitializeLog() is called are written to STDERR I0000 00:00:1751975655.975515 12352 voice_transcription.cc:58] Registering VoiceTranscriptionCapability [17524:5748:0708/172416.659:ERROR:google_apis\gcm\engine\registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT [17524:5748:0708/172417.593:ERROR:google_apis\gcm\engine\registration_request.cc:291] Registration response error message: PHONE_REGISTRATION_ERROR

    Created TensorFlow Lite XNNPACK delegate for CPU. Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#-1 is a dynamic-sized tensor).

    These logs are not related to my scraping logic, but they spam the output and are extremely annoying.

    From what I understand, this seems to be related to Chrome’s deprecated GCM (Google Cloud Messaging) system.

    MY SETUP --

    # Headless Chrome mode
    options.add_argument('--headless=new') # Use the new headless mode (Chrome 109+)

    # System and performance flags
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage')
    options.add_argument('--disable-gpu')
    options.add_argument('--mute-audio')
    options.add_argument('--metrics-recording-only')

    # Disable unnecessary features
    options.add_argument('--disable-extensions')
    options.add_argument('--disable-infobars')
    options.add_argument('--disable-notifications')
    options.add_argument('--disable-cloud-import')
    options.add_argument('--disable-sync')
    options.add_argument('--disable-client-side-phishing-detection')
    options.add_argument('--disable-background-networking')
    options.add_argument('--disable-background-timer-throttling')
    options.add_argument('--disable-backgrounding-occluded-windows')
    options.add_argument('--disable-component-update')
    options.add_argument('--disable-default-apps')

    # Privacy and identity
    options.add_argument('--no-first-run')
    options.add_argument('--no-default-browser-check')
    options.add_argument('--ignore-certificate-errors')
    options.add_argument('--guest')

    # Custom User-Agent
    options.add_argument(
    'user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
    'AppleWebKit/537.36 (KHTML, like Gecko) '
    'Chrome/98.0.4758.102 Safari/537.36'
    )

    # Suppress Selenium logs
    options.add_experimental_option('excludeSwitches', ['enable-logging'])

    # Optional: Use a persistent user profile
    if user_data_dir:
    options.add_argument(f'--user-data-dir={user_data_dir}')


    Despite using these, the errors still show up?

    Continue reading...

Compartilhe esta Página