Skip to content

SeleniumBase CDP Mode Not Working Properly in Docker Environment #3650

Closed
@taiwan-king

Description

@taiwan-king

I'm running the program on a Linux-based Docker container.
The script completes without errors, but the actual functionality doesn’t work as expected.
It seems like the issue might be related to CDP (Chrome DevTools Protocol).
I know you recommend using GitHub Actions, but I’m not familiar with it — I only know how to run things using Docker.

Could you please help me identify which part might be causing the issue?
This website sends an email upon successful login, and the email is successfully sent when running on Windows.
If there’s any other information you need from me, feel free to let me know — I’m happy to provide it.
Thanks a lot!
===Code===

import logging
from seleniumbase import SB

# 設定 logging 配置
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

with SB() as sb:
    logging.info("Enable CDP mode")
    sb.activate_cdp_mode()
    
    logging.info("Open the login page")
    sb.open("https://dash.domain.digitalplat.org/auth/login")
    sb.sleep(3)
    
    logging.info("Enter email")
    sb.press_keys("input#email", "MyAccount")
    sb.click_if_visible('button:contains("Next")')
    sb.sleep(3)
    
    logging.info("Enter password")
    sb.press_keys("#password", "MyPassword")
    sb.sleep(3)
    
    logging.info("Click the Login button")
    sb.click_if_visible('button:contains("Login")')
    sb.sleep(3)

===Log record===

Warning: chromedriver not found. Getting it now:
*** chromedriver to download = 135.0.7049.42 (Latest Stable) 
Downloading chromedriver-linux64.zip from:
https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.42/linux64/chromedriver-linux64.zip ...
Unzip Complete!
The file [chromedriver] was saved to:
/usr/local/lib/python3.13/site-packages/seleniumbase/drivers/
chromedriver
Making [chromedriver 135.0.7049.42] executable ...
[chromedriver 135.0.7049.42] is now ready for use!
2025-04-05 01:01:47,610 - INFO - Enable CDP mode
2025-04-05 01:01:49,931 - INFO - Detected root usage, auto-disabling sandbox mode.
2025-04-05 01:01:49,933 - INFO - Starting
    executable :/bin/google-chrome
arguments:
--window-size=1280,840
--window-position=20,54
--remote-allow-origins=*
    --no-first-run
    --no-service-autorun
    --disable-auto-reload
    --no-default-browser-check
--homepage=about:blank
    --no-pings
    --wm-window-animations-disabled
--animation-duration-scale=0
    --deny-permission-prompts
    --disable-infobars
    --disable-breakpad
    --disable-prompt-on-repost
    --disable-translate
    --disable-renderer-backgrounding
    --disable-background-networking
    --disable-dev-shm-usage
--disable-features=IsolateOrigins,site-per-process,Translate,InsecureDownloadWarnings,DownloadBubble,DownloadBubbleV2,OptimizationTargetPrediction,OptimizationGuideModelDownloading,SidePanelPinning,UserAgentClientHint,PrivacySandboxSettings4
2025-04-05 01:01:50,267 - INFO - Enabling autodiscover targets
2025-04-05 01:01:50,881 - INFO - Open the login page
2025-04-05 01:01:56,247 - INFO - Enter email
2025-04-05 01:02:02,506 - INFO - Enter password
2025-04-05 01:02:06,043 - INFO - Click the Login button

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeduplicateThe answer/solution already exists somewhere

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions