Replies: 7 comments 24 replies
-
|
Did you managed to pass the cloudflare on https://nowsecure.nl/ as in the README example? - Me not. But first, you have to build a patched remote selenium driver: # Dockerfile
FROM selenoid/chrome:117.0
USER root
RUN apt-get update || true
RUN apt-get install -y --no-install-recommends pip
RUN pip install undetected-chromedriver
COPY patch_driver.py .
RUN python3 patch_driver.pyand # patch_driver.py
from undetected_chromedriver import Patcher
Patcher(executable_path='/usr/bin/chromedriver').patch() or quit(1)Then you can make a workaround: import undetected_chromedriver as uc
class RemoteService:
SELENOID_HOST = 'your-selenoid-host'
service_url = f'http://{SELENOID_HOST}:4444/wd/hub' # If you use the driver container directly, remove `/wd/hub`.
path = '/usr/bin/true' # some existing fake path
def start(self):
pass
def stop(self):
pass
class UdChrome(uc.Chrome):
def __init__(self):
options = uc.ChromeOptions()
# Set your options here...
options._session = self
super(uc.Chrome, self).__init__(options=options, service=RemoteService(), keep_alive=True)
# Copy here what else you want from the uc.Chrome constructor...
self._delay = 3
self.options = options
# Test whether it passes the cloudflare check:
driver = UdChrome()
driver.get('https://nowsecure.nl')
import time; time.sleep(5)
driver.save_screenshot('nowsecure.png')
|
Beta Was this translation helpful? Give feedback.
-
|
@matez0 can your one pass iphey/pixelscan? If not maybe it no using the ucdriver |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
I could not reproduce so far what undetected chromedriver states in the readme. @hnnoye04 Could you provide a docker file to reproduce the stated feature for passing cloudflare on https://nowsecure.nl? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
@matez0 Just like thissss i just copy the code from seleniumbase/SeleniumBase@be477fa xddd |
Beta Was this translation helpful? Give feedback.
-
|
Doesn't work for me when using the above window open/close tactic with nopecha, does it still work for you? |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use Undetected Chrome driver within a Docker container, but there seems to be no Remote module to do so. This is the code I'm trying to use, as seen in this tutorial (https://www.browserstack.com/guide/run-selenium-tests-in-docker).
Beta Was this translation helpful? Give feedback.
All reactions