kaliiiiiiiiii / Selenium-Profiles

undetected Selenium using chromedriver and emulation / device profiles
Other
272 stars 29 forks source link

unpack extentions are not loading. #99

Closed Mehranali669 closed 11 months ago

Mehranali669 commented 1 year ago

unpack extentions are not loading i was using this but in my case i want to load some unpack extention these extentions are not loading in driver. i have tried such things but nothing is working in chrome 116

code i have tried

#options.add_argument(f"--load-extension={profile['extentions']}");
options.add_argument(f"load-extension={profile['extentions']}");
options.add_extension(f"--load-extension={profile['extentions']}");
kaliiiiiiiiii commented 1 year ago

@Mehranali669 please provide the full code you used including the path to the extension you want to add

Mehranali669 commented 1 year ago

this is the code i was running. also when i use uc_driver=True it wont work the chrome is like its crash or some thing

from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from seleniumwire import webdriver

profilenew = profiles.Windows() # or .Android
options = webdriver.ChromeOptions()

options.add_extension(r"C:\Users\MehranAli\Desktop\moto\webAuto\extentions\emptyProxy");
# options.add_argument(r"--load-extension=C:\Users\MehranAli\Desktop\moto\webAuto\extentions\emptyProxy");
# options.add_argument(r"load-extension=C:\Users\MehranAli\Desktop\moto\webAuto\extentions\emptyProxy");

driver = Chrome(profilenew, options=options,uc_driver=False, seleniumwire_options=True)
# get url
driver.get('https://google.com/') 
kaliiiiiiiiii commented 1 year ago

@Mehranali669

  1. What error do you get with uc_driver=True ?
  2. What happens when adding a extension? Does it just ignore it, or is there any error?
  3. Does something like the following work?
    profile["options"]["extension_paths"] = ["C:/some_path/extension"]

UPDATE This seems to occurr because of the following line: https://github.com/kaliiiiiiiiii/Selenium-Profiles/blob/109382aa096065ead5d559f9a1830d764b64bc5e/src/selenium_profiles/webdriver.py#L151

Todo: Add custom selenium-driverless.webdriver.ChromeOptions