disconnected: unable to send message to renderer (failed to check if window was closed: disconnected: not connected to DevTools) (Session info: chrome=115.0.5790.110)
用的 selenium/standalone-chrome 镜像没有做任何的更改,一访问 http://127.0.0.1:4444/wd/hub 提示如下:
disconnected: unable to send message to renderer (failed to check if window was closed: disconnected: not connected to DevTools) (Session info: chrome=115.0.5790.110) Stacktrace: #0 0x556589d13783 <unknown> #1 0x556589a3f917 <unknown> #2 0x556589a24ad2 <unknown> #3 0x556589a254df <unknown> #4 0x556589a423cd <unknown> #5 0x556589a42c60 <unknown> #6 0x556589a45720 <unknown> #7 0x556589a457dc <unknown> #8 0x556589a7e048 <unknown> #9 0x556589a7e411 <unknown> #10 0x556589ab96b1 <unknown> #11 0x556589a9ee2d <unknown> #12 0x556589ab70d9 <unknown> #13 0x556589a9ebd3 <unknown> #14 0x556589a72a7b <unknown> #15 0x556589a7381e <unknown> #16 0x556589cd4e98 <unknown> #17 0x556589cd8d67 <unknown> #18 0x556589ce332c <unknown> #19 0x556589cd9993 <unknown> #20 0x556589ca8827 <unknown> #21 0x556589cfd8a8 <unknown> #22 0x556589cfda36 <unknown> #23 0x556589d0c5f3 <unknown> #24 0x7f40a3a85609 start_thread
我碰到的环境,就是设置下容器运行的内存,就可以了,以下是docker-compose.yml
version: '3' services: app: container_name: "news-python" image: python:3.11-slim volumes: - E:\python\news-reply:/app # 映射宿主机上的目录到容器内部的 /app 目录 - E:\python\uploadfile:/app/static/uploadfile working_dir: /app command: sh -c "pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt && python main.py" depends_on: - selenium - mongodb networks: - my_python_network selenium: container_name: "news-python-selenium" # image: selenium/standalone-chrome-debug image: selenium/standalone-chrome volumes: - E:\python\news-reply:/app # 映射宿主机上的目录到容器内部的 /app 目录 ports: - "4444:4444" # - "5900:5900" # 不给定内存可能会报错 shm_size: 2G networks: - my_python_network # 添加 mongodb 服务 mongodb: container_name: "news-python-mongodb" image: mongo ports: - "27018:27017" networks: - my_python_network networks: my_python_network: driver: bridge