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

Undetected-Chromedriver not working with compiled .exe version.

Open xooelae opened this issue 2 years ago • 7 comments

Hi, I compile my python program with cx_freeze after compile i have tried so many times to run undetected chromedriver but its never worked! But Selenium is working fine without any issue.

When i run with undetected chromedriver it shows a error that init() got an unexpected keyword argument 'driver_executable_path'

This error shows up only when i convert the python program to exe. I also tried py2exe same issue happens.

xooelae avatar Jul 20 '22 10:07 xooelae

i using pyinstaller without arg one-file

yeucodonvn avatar Aug 08 '22 03:08 yeucodonvn

i using pyinstaller without arg one-file

Even if it's run properly it can't bypass the cloudflare on complied version also if we add options it run like normal selenium. Can you please help me to solve these issue?

xooelae avatar Aug 08 '22 03:08 xooelae

driver = uc.Chrome(use_subprocess=True)

no-name-user-name avatar Aug 31 '22 10:08 no-name-user-name

driver = uc.Chrome(use_subprocess=True)

It worked thanks!

Also can you help me how to hide the console with compiled version for undetected chromedriver, i have tried freeze_support() on the top of the code also i tried chrome_service.creationflags = CREATE_NO_WINDOW but it doesn't worked for me, it always open a blank console.

Thanks for your reply

mechxer avatar Sep 01 '22 13:09 mechxer

for cx_freeze on Windows use base = "Win32GUI"

import cx_Freeze

exe = [cx_Freeze.Executable("main.py", base = "Win32GUI")]

cx_Freeze.setup(
    name = "Name",
    version = "1.0",
    options = {"build_exe": {"packages": [],  
        "include_files": []}},
    executables = exe
) 

for pyinstaller: pyinstaller --noconsole yourscript.py

driver = uc.Chrome(use_subprocess=True)

It worked thanks!

Also can you help me how to hide the console with compiled version for undetected chromedriver, i have tried freeze_support() on the top of the code also i tried chrome_service.creationflags = CREATE_NO_WINDOW but it doesn't worked for me, it always open a blank console.

Thanks for your reply

no-name-user-name avatar Sep 01 '22 14:09 no-name-user-name

for cx_freeze on Windows use base = "Win32GUI"

import cx_Freeze

exe = [cx_Freeze.Executable("main.py", base = "Win32GUI")]

cx_Freeze.setup(
    name = "Name",
    version = "1.0",
    options = {"build_exe": {"packages": [],  
        "include_files": []}},
    executables = exe
) 

for pyinstaller: pyinstaller --noconsole yourscript.py

driver = uc.Chrome(use_subprocess=True)

It worked thanks! Also can you help me how to hide the console with compiled version for undetected chromedriver, i have tried freeze_support() on the top of the code also i tried chrome_service.creationflags = CREATE_NO_WINDOW but it doesn't worked for me, it always open a blank console. Thanks for your reply

Yes i always compile with Win32GUI in Cx_Freeze But it doesn't not worked for me.

If you have other solution please help us.

Thanks again.

xooelae avatar Sep 01 '22 16:09 xooelae

@mechxer

Also can you help me how to hide the console with compiled version for undetected chromedriver i tried chrome_service.creationflags = CREATE_NO_WINDOW but it doesn't worked for me, it always open a blank console

This is non-trivial because UC creates its own service and you can't simply set the creationflags to an existing service. Please check #623 where you'll find how to make it work.

sebdelsol avatar Sep 02 '22 10:09 sebdelsol