undetected-chromedriver
undetected-chromedriver copied to clipboard
Not Support all options like webdriver
Hi, to bypass the bot detection, I first run chrome.exe and then take control but when I try to do it with the "uc" library it doesn't work
chromeadres="C:\Program Files\Google\Chrome\Application\chrome.exe" lokalproxy="55000" options = uc.ChromeOptions() options.add_experimental_option("debuggerAddress", "127.0.0.1:9225") chrome_driver = "C:/analizer/chromedriver.exe" subprocess.Popen([chromeadres,"--incognito","--remote-debugging-port=9225","--disable-infobars","--proxy-server=http://localhost:"+lokalproxy]) time.sleep(0.5) driver =webdriver.Chrome(executable_path=chrome_driver,chrome_options=options,seleniumwire_options={'port':int(lokalproxy)}) driver.get('https://nowsecure.nl')
it works but not pass "nowsecure.nl"
chromeadres="C:\Program Files\Google\Chrome\Application\chrome.exe" lokalproxy="55000" options = uc.ChromeOptions() options.add_experimental_option("debuggerAddress", "127.0.0.1:9225") chrome_driver = "C:/analizer/chromedriver.exe" subprocess.Popen([chromeadres,"--incognito","--remote-debugging-port=9225","--disable-infobars","--proxy-server=http://localhost:"+lokalproxy]) time.sleep(0.5) driver =uc.Chrome(executable_path=chrome_driver,chrome_options=options,seleniumwire_options={'port':int(lokalproxy)}) driver.get('https://nowsecure.nl')
if i changed webdriver-->uc is doesnt work.. gets this errors
Traceback (most recent call last):
File "C:\Python\Interpreter\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\Python\Interpreter\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Python\Interpreter\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="mp_main")
File "C:\Python\Interpreter\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Python\Interpreter\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Python\Interpreter\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Python\sahibfavori\sil.py", line 84, in
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Thanks,regards
- You don't need to manually open the Chrome process, undetected-chromedriver does that for you. And the Chrome process is detached which is better for avoiding detection.
- Only
'prefs'
experimental options are supported, because the driver can't push experimental options on an already opened browser. For'prefs'
there's a workaround by modifying the the Chrome profile Preferences file. - If you want selenium-wire working with undetected-chromedriver, please check their documentation here.
- For the multiprocessing error : you've stumbled upon a recurrent non-issue .
- You don't need to manually open the Chrome process, undetected-chromedriver does that for you. And the Chrome process is detached which is better for avoiding detection.
- Only
'prefs'
experimental options are supported, because the driver can't push experimental options on an already opened browser. For'prefs'
there's a workaround by modifying the the Chrome profile Preferences file.- If you want selenium-wire working with undetected-chromedriver, please check their documentation here.
- For the multiprocessing error : you've stumbled upon a recurrent non-issue .
How can I use these value params = [ self.executablePath, '--remote-debugging-port='+str(self.port), '--user-data-dir='+self.profile_path, '--password-store=basic', ] subprocess.Popen(params, start_new_session=True) with undetectchromedriver?