ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.57k stars 1.14k forks source link

Deploying on Docker / Google Cloud Run #269

Open lewgaowei opened 3 years ago

lewgaowei commented 3 years ago

Need help with dockerizing undetectable chrome

The following code works for normal webdriver, however there are issues with UC (might be due to webdriver path?) https://stackoverflow.com/questions/65576321/dockerfile-for-a-python-script-with-firefox-based-selenium-web-driver-flask-b

Any help will be appreciated

HMaker commented 3 years ago

see #262

mhmehdi commented 3 years ago

i have the same problem with undetected-chromedriver on docker selenium work fine but undetected-chromedriver dont (browser get crash ) `FROM python:3.8.11-slim-buster

ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1

install chrome

RUN apt-get update \ && apt-get install -y --no-install-recommends wget \ && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ && apt install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb \ && rm google-chrome-stable_current_amd64.deb \ && chown root.root -R /opt/google/chrome/ \ && chmod 755 -R /opt/google/chrome/ \ && chmod 4755 -R /opt/google/chrome/chrome-sandbox

install python dependencies ...

RUN python -m venv /appenv ENV VIRTUAL_ENV /appenv ENV PATH /appenv/bin:$PATH

maybe RUN pip install -r requirements.txt

install chromedriver

ENV CHROMEDRIVER_PATH /appenv/chromedriver RUN python -c "from undetected_chromedriver.patcher import Patcher; patcher = Patcher(executable_path='$CHROMEDRIVER_PATH', version_main=$(google-chrome --version | grep -Po ' [0-9]{1,3}.' | sed 's:^.(.*).$:\1:')); assert patcher.auto()" RUN chmod +x /appenv/chromedriver ` and this doesn't work me and get error about that there is no directory or file name (/appenv/chromedriver)

HMaker commented 3 years ago

@mhmehdi paste the error message here... I use that Dockerfile and have no problems.

mhmehdi commented 3 years ago

I find the problem and fixed but now its get detected with Cloudflare : |

xino1010 commented 2 years ago

@mhmehdi would you mind to share your dockerfile please?

Anticope12 commented 2 years ago

Following :)

roman4ello commented 2 years ago

Following

smsajjadzaidi commented 1 year ago

following