umihico / docker-selenium-lambda

The simplest demo of chrome automation by python and selenium in AWS Lambda
MIT License
535 stars 127 forks source link

Update to latest chrome/chromedriver #197

Closed rcolwell-cb closed 11 months ago

rcolwell-cb commented 12 months ago

Seems like I was able to do it on my end w/ switching --headless flag to --headless=new. v117 versions

umihico commented 12 months ago

@rcolwell-cb Great. Could you show your Dockerfile please? It will be big help

rcolwell-cb commented 12 months ago
FROM public.ecr.aws/lambda/python:3.11 as build

RUN yum install -y unzip && \
    curl -Lo "/tmp/chromedriver-linux64.zip" "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/linux64/chromedriver-linux64.zip" && \
    curl -Lo "/tmp/chrome-linux64.zip" "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/linux64/chrome-linux64.zip" && \
    unzip /tmp/chromedriver-linux64.zip -d /opt/ && \
    unzip /tmp/chrome-linux64.zip -d /opt/
FROM public.ecr.aws/lambda/python:3.11

RUN yum install atk cups-libs gtk3 libXcomposite alsa-lib \
    libXcursor libXdamage libXext libXi libXrandr libXScrnSaver \
    libXtst pango at-spi2-atk libXt xorg-x11-server-Xvfb \
    xorg-x11-xauth dbus-glib dbus-glib-devel -y
RUN pip install selenium==4.14.0
COPY --from=build /opt/chrome-linux64 /opt/chrome
COPY --from=build /opt/chromedriver-linux64 /opt/
COPY src/main.py ./
CMD [ "main.handler" ]
rcolwell-cb commented 12 months ago

that + ==headless=new seems to work.

umihico commented 12 months ago

Thank you!! I'll check and try to modify auto-update 🙏

umihico commented 11 months ago

@rcolwell-cb Thank you finally I could update because of your help.