undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

Detected: CloudFlare Turnstile Challenge Failed

Open ExpiredMeteor6 opened this issue 1 year ago • 22 comments

image

Hi all, does anyone have any fixes for this?

See below for my arguments:

image

ExpiredMeteor6 avatar Aug 11 '23 19:08 ExpiredMeteor6

if you use window, you can use this, and of course the file is safe as long as it's not deleted by github even though it's uncompressed https://github.com/AntidetectBrowser/ChromeDriverBypassCloudflareForWindow

AntidetectBrowser avatar Aug 12 '23 01:08 AntidetectBrowser

if you use window, you can use this, and of course the file is safe as long as it's not deleted by github even though it's uncompressed https://github.com/AntidetectBrowser/ChromeDriverBypassCloudflareForWindow

Hey would be nice if we can see the actual python stuff, new account and only exe is just a bit to risky :/

If anyone can vouch I may be more trusting! Thanks for the response

ExpiredMeteor6 avatar Aug 12 '23 01:08 ExpiredMeteor6

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

denniswung avatar Aug 12 '23 01:08 denniswung

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

Have had a look, not sure what/how this will help? Would you be able to expand on this please :) Thanks for the response!

**Edit: have seen about the no webdriver and use open browsers feature, will play around with tomorrow

ExpiredMeteor6 avatar Aug 12 '23 01:08 ExpiredMeteor6

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

Have had a look, not sure what/how this will help? Would you be able to expand on this please :) Thanks for the response!

**Edit: have seen about the no webdriver and use open browsers feature, will play around with tomorrow

I think you could try it. This is a simple python3 example

pip install DrissionPage
# -*- coding:utf-8 -*-
import time
from DrissionPage import ChromiumPage, ChromiumOptions


def pass_cycle(_driver: ChromiumPage):
    """Pass"""
    try:
        if _driver('xpath://div/iframe').s_ele("xpath://input[@type='checkbox']") is not None:
            _driver('xpath://div/iframe').ele("xpath://input[@type='checkbox']", timeout=0.1).click()
    except:
        pass


if __name__ == '__main__':
    # Chromium Browser Path
    browser_path = r"C:\\Soft\\chrome_114.0.5735.134\\chrome.exe"

    options = ChromiumOptions()
    options.set_paths(browser_path=browser_path)

    arguments = [
        "-no-first-run",
        "-force-color-profile=srgb",
        "-metrics-recording-only",
        "-password-store=basic",
        "-use-mock-keychain",
        "-export-tagged-pdf",
        "-no-default-browser-check",
        "-disable-background-mode",
        "-enable-features=NetworkService,NetworkServiceInProcess,LoadCryptoTokenExtension,PermuteTLSExtensions",
        "-disable-features=FlashDeprecationWarning,EnablePasswordsAccountStorage",
        "-deny-permission-prompts",
        "-disable-gpu"
        # "-headless=new"
        # "-incognito"
        # "-user-data-dir=D:\\System\\Desktop\\Undetected\\Drission_Dennis\\tmp\\"
    ]

    for argument in arguments:
        options.set_argument(argument)

    driver = ChromiumPage(addr_driver_opts=options)

    driver.get('https://nowsecure.nl')

    # Pass Cloudflare
    while True:
        pass_cycle(driver)
        try:
            ele = driver.s_ele('xpath://h3')
            if ele.text == "nowSecure.nl":
                break
        except:
            time.sleep(.1)

    driver.quit()

    print("Done")

denniswung avatar Aug 12 '23 02:08 denniswung

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

Have had a look, not sure what/how this will help? Would you be able to expand on this please :) Thanks for the response! **Edit: have seen about the no webdriver and use open browsers feature, will play around with tomorrow

I think you could try it. This is a simple python3 example

pip install DrissionPage
# -*- coding:utf-8 -*-
import time
from DrissionPage import ChromiumPage, ChromiumOptions


def pass_cycle(_driver: ChromiumPage):
   """Pass"""
   try:
       _driver('xpath://div/iframe').s_ele("xpath://input[@type='checkbox']")
       _driver('xpath://div/iframe').ele("xpath://input[@type='checkbox']", timeout=0.1).click()
   except:
       pass


if __name__ == '__main__':
   # Chromium Browser Path
   browser_path = r"C:\\Soft\\chrome_114.0.5735.134\\chrome.exe"

   options = ChromiumOptions()
   options.set_paths(browser_path=browser_path)

   arguments = [
       "-no-first-run",
       "-force-color-profile=srgb",
       "-metrics-recording-only",
       "-password-store=basic",
       "-use-mock-keychain",
       "-export-tagged-pdf",
       "-no-default-browser-check",
       "-disable-background-mode",
       "-enable-features=NetworkService,NetworkServiceInProcess,LoadCryptoTokenExtension,PermuteTLSExtensions",
       "-disable-features=FlashDeprecationWarning,EnablePasswordsAccountStorage",
       "-deny-permission-prompts",
       "-disable-gpu"
       # "-headless=new"
       # "-incognito"
       # "-user-data-dir=D:\\System\\Desktop\\Undetected\\Drission_Dennis\\tmp\\"
   ]

   for argument in arguments:
       options.set_argument(argument)

   driver = ChromiumPage(addr_driver_opts=options)

   driver.get('https://nowsecure.nl')

   # Pass Cloudflare
   while True:
       pass_cycle(driver)
       try:
           ele = driver.s_ele('xpath://h3')
           if ele.text == "nowSecure.nl":
               break
       except:
           time.sleep(.1)

   driver.quit()

   print("Done")

Will attempt tomorrow, thanks for the advice!

ExpiredMeteor6 avatar Aug 12 '23 02:08 ExpiredMeteor6

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

nice package, sir

henzycuong1 avatar Aug 12 '23 03:08 henzycuong1

@ExpiredMeteor6 I got this error

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 179, in _run_browser return Popen(arguments, shell=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 41, in connect_browser debugger = _run_browser(port, chrome_path, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 181, in _run_browser raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。') FileNotFoundError: 未找到浏览器,请手动指定浏览器可执行文件路径。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/alif/ManPower/VFS_APPOINTMENT/vfs-slots-api-monitor-main/test_workflow.py", line 43, in driver = ChromiumPage(addr_driver_opts=options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_page.py", line 36, in init super().init(addr_driver_opts, tab_id, timeout) File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_base.py", line 50, in init self._connect_browser(tab_id) File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_page.py", line 81, in _connect_browser connect_browser(self._driver_options) File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 49, in connect_browser raise FileNotFoundError('无法找到chrome路径,请手动配置。') FileNotFoundError: 无法找到chrome路径,请手动配置。

trying in MacOS

saroar avatar Aug 12 '23 19:08 saroar

@ExpiredMeteor6 I got this error

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 179, in _run_browser return Popen(arguments, shell=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 41, in connect_browser debugger = _run_browser(port, chrome_path, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 181, in _run_browser raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。') FileNotFoundError: 未找到浏览器,请手动指定浏览器可执行文件路径。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/alif/ManPower/VFS_APPOINTMENT/vfs-slots-api-monitor-main/test_workflow.py", line 43, in driver = ChromiumPage(addr_driver_opts=options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_page.py", line 36, in init super().init(addr_driver_opts, tab_id, timeout) File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_base.py", line 50, in init self._connect_browser(tab_id) File "/usr/local/lib/python3.11/site-packages/DrissionPage/chromium_page.py", line 81, in _connect_browser connect_browser(self._driver_options) File "/usr/local/lib/python3.11/site-packages/DrissionPage/commons/browser.py", line 49, in connect_browser raise FileNotFoundError('无法找到chrome路径,请手动配置。') FileNotFoundError: 无法找到chrome路径,请手动配置。

trying in MacOS

I only run this code normally under windows and linux. According to your information, you seem to have not configured the address of the browser, this tool does not need chromedriver.

# Chromium Browser Path (Replace it with the address of the chromium-based browser)

# windows
browser_path = r"C:\\Soft\\chrome_114.0.5735.134\\chrome.exe"

# linux
browser_path = r"/usr/bin/google-chrome"

denniswung avatar Aug 13 '23 01:08 denniswung

what is the difference between driver.s_ele and driver.ele please?

Krylanc3lo avatar Aug 13 '23 03:08 Krylanc3lo

As I know, s_ele and eles like driver.find_element in selenium. But the "ele" for dynamic elements and taking to much time, the "s_ele" is not

On Sun, Aug 13, 2023, 10:21 Krylancelo @.***> wrote:

what is the difference between driver.s_ele and driver.ele please?

— Reply to this email directly, view it on GitHub https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1462#issuecomment-1676204769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFVQESJXTAEIKAIQJZT52DXVBB5JANCNFSM6AAAAAA3NLDQHU . You are receiving this because you commented.Message ID: @.*** com>

henzycuong1 avatar Aug 13 '23 04:08 henzycuong1

As I know, s_ele and eles like driver.find_element in selenium. But the "ele" for dynamic elements and taking to much time, the "s_ele" is not On Sun, Aug 13, 2023, 10:21 Krylancelo @.> wrote: what is the difference between driver.s_ele and driver.ele please? — Reply to this email directly, view it on GitHub <#1462 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFVQESJXTAEIKAIQJZT52DXVBB5JANCNFSM6AAAAAA3NLDQHU . You are receiving this because you commented.Message ID: @. com>

Yes, s_ele is faster than ele, but it cannot manipulate elements, only static data

denniswung avatar Aug 13 '23 05:08 denniswung

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

Have had a look, not sure what/how this will help? Would you be able to expand on this please :) Thanks for the response! **Edit: have seen about the no webdriver and use open browsers feature, will play around with tomorrow

I think you could try it. This is a simple python3 example

pip install DrissionPage
# -*- coding:utf-8 -*-
import time
from DrissionPage import ChromiumPage, ChromiumOptions


def pass_cycle(_driver: ChromiumPage):
    """Pass"""
    try:
        if _driver('xpath://div/iframe').s_ele("xpath://input[@type='checkbox']") is not None:
            _driver('xpath://div/iframe').ele("xpath://input[@type='checkbox']", timeout=0.1).click()
    except:
        pass


if __name__ == '__main__':
    # Chromium Browser Path
    browser_path = r"C:\\Soft\\chrome_114.0.5735.134\\chrome.exe"

    options = ChromiumOptions()
    options.set_paths(browser_path=browser_path)

    arguments = [
        "-no-first-run",
        "-force-color-profile=srgb",
        "-metrics-recording-only",
        "-password-store=basic",
        "-use-mock-keychain",
        "-export-tagged-pdf",
        "-no-default-browser-check",
        "-disable-background-mode",
        "-enable-features=NetworkService,NetworkServiceInProcess,LoadCryptoTokenExtension,PermuteTLSExtensions",
        "-disable-features=FlashDeprecationWarning,EnablePasswordsAccountStorage",
        "-deny-permission-prompts",
        "-disable-gpu"
        # "-headless=new"
        # "-incognito"
        # "-user-data-dir=D:\\System\\Desktop\\Undetected\\Drission_Dennis\\tmp\\"
    ]

    for argument in arguments:
        options.set_argument(argument)

    driver = ChromiumPage(addr_driver_opts=options)

    driver.get('https://nowsecure.nl')

    # Pass Cloudflare
    while True:
        pass_cycle(driver)
        try:
            ele = driver.s_ele('xpath://h3')
            if ele.text == "nowSecure.nl":
                break
        except:
            time.sleep(.1)

    driver.quit()

    print("Done")

很好,終於解決5秒盾了

kit1858644 avatar Aug 14 '23 22:08 kit1858644

@kit1858644 如果过于广为人知,程序可能会被阻止。我们能否删除相关链接?

wangpangs avatar Aug 15 '23 08:08 wangpangs

Try this, of course you need to use it with a translator. https://github.com/g1879/DrissionPage

Have had a look, not sure what/how this will help? Would you be able to expand on this please :) Thanks for the response! **Edit: have seen about the no webdriver and use open browsers feature, will play around with tomorrow

I think you could try it. This is a simple python3 example

pip install DrissionPage
# -*- coding:utf-8 -*-
import time
from DrissionPage import ChromiumPage, ChromiumOptions


def pass_cycle(_driver: ChromiumPage):
    """Pass"""
    try:
        if _driver('xpath://div/iframe').s_ele("xpath://input[@type='checkbox']") is not None:
            _driver('xpath://div/iframe').ele("xpath://input[@type='checkbox']", timeout=0.1).click()
    except:
        pass


if __name__ == '__main__':
    # Chromium Browser Path
    browser_path = r"C:\\Soft\\chrome_114.0.5735.134\\chrome.exe"

    options = ChromiumOptions()
    options.set_paths(browser_path=browser_path)

    arguments = [
        "-no-first-run",
        "-force-color-profile=srgb",
        "-metrics-recording-only",
        "-password-store=basic",
        "-use-mock-keychain",
        "-export-tagged-pdf",
        "-no-default-browser-check",
        "-disable-background-mode",
        "-enable-features=NetworkService,NetworkServiceInProcess,LoadCryptoTokenExtension,PermuteTLSExtensions",
        "-disable-features=FlashDeprecationWarning,EnablePasswordsAccountStorage",
        "-deny-permission-prompts",
        "-disable-gpu"
        # "-headless=new"
        # "-incognito"
        # "-user-data-dir=D:\\System\\Desktop\\Undetected\\Drission_Dennis\\tmp\\"
    ]

    for argument in arguments:
        options.set_argument(argument)

    driver = ChromiumPage(addr_driver_opts=options)

    driver.get('https://nowsecure.nl')

    # Pass Cloudflare
    while True:
        pass_cycle(driver)
        try:
            ele = driver.s_ele('xpath://h3')
            if ele.text == "nowSecure.nl":
                break
        except:
            time.sleep(.1)

    driver.quit()

    print("Done")

can u dm me on my discord , i needed some help regarding drissionpage discord id - vivek9646

vndhote avatar Aug 15 '23 18:08 vndhote

do you know how to get rid of "devtools listening on ws://127.0.0.1" message by any chance?

Thanks a lot

Krylanc3lo avatar Aug 17 '23 04:08 Krylanc3lo

patched

greathope avatar Aug 17 '23 11:08 greathope

@greathope what do you mean?

Krylanc3lo avatar Aug 17 '23 13:08 Krylanc3lo

@greathope what do you mean?

he doesnt want others to use it or it will for real be patched.

jewqrkqwrwq avatar Aug 17 '23 16:08 jewqrkqwrwq

It's easy. Watch these two videos. https://m.bilibili.com/video/BV1f24y1c7qG ​https://m.bilibili.com/video/BV1go4y1t7xD

danny1879 avatar Aug 20 '23 12:08 danny1879

can you provide some help for using playwrite for automation testing

Tanmay-Test-08 avatar Feb 07 '24 06:02 Tanmay-Test-08

it works,thanks

liujing007008 avatar Apr 23 '24 18:04 liujing007008