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.06k stars 1.09k forks source link

Chromedriver executable may have wrong permissions when undetected #609

Open lollofos opened 2 years ago

lollofos commented 2 years ago

Until yesterday my code was perfectly working but today when I run it i get an error saying

WebDriverException: Message: '062df107007c8a29_chromedriver.exe' executable may have wrong permissions. Please see https://chromedriver.chromium.org/home This is my code

crome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--enable-javascript')
chrome_options.add_argument('--disable-gpu')
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15'
chrome_options.add_argument('User-Agent={0}'.format(user_agent))
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_experimental_option('useAutomationExtension', True)
driver = uc.Chrome(executable_path=r'C:\Users\xxx\Desktop\chromedriver.exe',chrome_options=chrome_options,service_args=['--quiet'])
driver.set_window_size(1024, 600)
driver.maximize_window()

If i run the code without the uc, everythink goes perfect.

Chromedriver & chrome are both updated to latest versions

mdp18 commented 2 years ago

I'd double check your code.. crome_options = webdriver.ChromeOptions() should be

import undetected_chromedriver.v2 as uc
chrome_options = uc.ChromeOptions()
Nawi98 commented 1 year ago

Hello @mdp18 , @lollofos . I have the same issue. I am using these 2 videos to set up my use case: https://youtu.be/dYAytG965ZE?list=PLuJJZ-W1NwdoTS0UXLUZoPH7GQ0kURHgH https://youtu.be/QvaZLa_FKmY?list=PLuJJZ-W1NwdoTS0UXLUZoPH7GQ0kURHgH The fact is since I am setting up an automated test , I need selenium(an automated testing tool) to be undected by chrome. Else Chrome will block my script execution (I'll not be able to log in). Here is my code, written in python :

#--------------------------getting into Myriad login page--------------------------------------

def login():

# find the "email" and "password" fields then fill them
#but before let s locate them
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "userEmail")) )
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "password")) )
driver.find_element(By.ID, "userEmail").send_keys("myaccount@gmail.com")
driver.find_element(By.ID, "password").send_keys("123456")

#find out the login Button location then click on it
loginClick = driver.find_element(By.CSS_SELECTOR, ".customStyle__ButtonDefault___1k2JQ").click()

def main():
    logged = login()   

#------------------------------------------------end login part----------------------------------------------------

if __name__ == '__main__':  

from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
import undetected_chromedriver.v2 as uc
chrome_options = uc.ChromeOptions()
driver = uc.Chrome()
driver.get("https://pubpp-developers.myriadgroup.mobi/login")

I am still going though that issue: image May I know where I am wrong please? Else, could you please tell me if there's another way to get undetected by Chrome while using selenium python webDriver

sebdelsol commented 1 year ago

Run :

import undetected_chromedriver as uc
print(uc.Patcher.data_path)

And check you have the right permissions for the given folder.