Traceback
2025-01-27 11:20:33,075 ERROR Message: disconnected: Unable to receive message from renderer
(failed to check if window was closed: disconnected: not connected to DevTools)
(Session info: chrome=130.0.6723.69)
Stacktrace:
#0 0x004000a0e6da <unknown>
#1 0x004000522f80 <unknown>
#2 0x00400050b5e3 <unknown>
#3 0x00400050935c <unknown>
#4 0x004000509b0f <unknown>
#5 0x004000523afd <unknown>
#6 0x0040004f8ac9 <unknown>
#7 0x0040004f8416 <unknown>
#8 0x00400059feff <unknown>
#9 0x00400059f346 <unknown>
#10 0x004000593953 <unknown>
#11 0x00400056272e <unknown>
#12 0x00400056379e <unknown>
#13 0x0040009d9f1b <unknown>
#14 0x0040009ddeb8 <unknown>
#15 0x0040009c742c <unknown>
#16 0x0040009dea37 <unknown>
#17 0x0040009abfef <unknown>
#18 0x0040009fcad8 <unknown>
#19 0x0040009fcca0 <unknown>
#20 0x004000a0d556 <unknown>
#21 0x004002e151c4 <unknown>
Dockerfile
FROM --platform=linux/amd64 python:3.9-slim
WORKDIR /app
COPY requirements.txt .
# Install the required packages
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y \
wget \
unzip \
libnss3 \
libgconf-2-4 \
libxss1 \
libxrandr2 \
libx11-xcb1 \
libxcomposite1 \
libxcursor1 \
libxi6 \
libxtst6 \
libglib2.0-0 \
libasound2 \
fonts-liberation \
libappindicator3-1 \
libgtk-3-0 \
libdrm2 \
libgbm1 \
libvulkan1 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y wget curl unzip gnupg --no-install-recommends
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | \
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/google.gpg --import; \
chmod 644 /etc/apt/trusted.gpg.d/google.gpg; \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
# RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
# apt-get install -y ./google-chrome-stable_current_amd64.deb && \
# rm google-chrome-stable_current_amd64.deb
ARG CHROME_VERSION="130.0.6723.69-1"
RUN wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN rm -f google-chrome-stable_${CHROME_VERSION}_amd64.deb
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY . .
CMD ["python", "main.py"]
Помогите разобраться в чем причина ошибки
Настройки webdriver
def create_driver():
options = Options()
options.add_argument("--headless")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-gpu")
options.add_argument("--no-sandbox")
driver = webdriver.Chrome(options=options)
return driver
selenium==4.26.1