-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
I have multiple extension paths. When i used one it was easy:
extension_path2 = f"extensions/fpd" driver = Driver(uc=True, agent=user_agent, extension_dir=extension_path2, incognito=True, proxy=proxy_cred, uc_cdp_events=True)
But i have multiple extensions. Example:
extension_path2 = f"extensions/fpd" extension_path3 = f"extensions/httphm"
I tried puting it in list but it doesnt work, it requiers string:
driver = Driver(uc=True, agent=user_agent, extension_dir=[extension_path2, extension_path3], incognito=True, proxy=proxy_cred, uc_cdp_events=True)
I also tried this solution:
extension_dirs = [extension_path2, extension_path3] combined_extension_path = ','.join(extension_dirs) driver = Driver(uc=True, agent=user_agent, extension_dir=combined_extension_path, incognito=True, proxy=proxy_cred, uc_cdp_events=True)
It renders the first path good, but second path tries to find it in my main google chrome path in extensions.
Any help with this?
Beta Was this translation helpful? Give feedback.
All reactions
Make sure you use a comma-separated string (no spaces) for loading multiple chrome extension directories in UC Mode.
Also note that you can't use extensions with Incognito Mode or Guest Mode: #2336 (comment)
(That restriction was made by Google: https://support.google.com/chrome_webstore/answer/2664769?hl=en)
Replies: 2 comments 5 replies
-
Make sure you use a comma-separated string (no spaces) for loading multiple chrome extension directories in UC Mode.
Also note that you can't use extensions with Incognito Mode or Guest Mode: #2336 (comment)
(That restriction was made by Google: https://support.google.com/chrome_webstore/answer/2664769?hl=en)
Beta Was this translation helpful? Give feedback.
All reactions
-
Still got issue. Explanation of the issue below. Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks, but still got the error. It loads the link of first correctly but the link of the second doesnt. I get the error and it try to add aditional path to the my link.
driver = Driver(uc=True, agent=user_agent, extension_dir='extensions/fpd, extensions/httphm', proxy=proxy_cred, uc_cdp_events=True)
Beta Was this translation helpful? Give feedback.
All reactions
-
I mentioned earlier in #2672 (comment): "comma-separated string (no spaces)"
You had a space in your extension_dir
string.
Also, "Manifest file is missing or unreadable"
means that there may be something wrong with the formatting of your extension.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your time to anwser. i still got same error pop up with or without the space. When i load them separately they are good, everything works, but every time i try to load them together the second one cant load. As you can see in the picture above it try to load extension from C:\Program Files\Google\Chrome\Application123円.0.6312.106... which i dont want, path of my extension is:
C:\Users\HP\Desktop\No Com\extensions\httphm. Did you run into this bug before?
extension_dir='extensions/httphm,extensions/fpd'
Edit:
I found a way but i dont think i will be able to export that:
extension_dir='extensions/fpd,httphm'
extension/fpd is in my script directory: C:\Users\HP\Desktop\No Com\extensions\fpd
httphm is in googles chrome directory: C:\Program Files\Google\Chrome\Application123円.0.6312.107\httphm
So the script works but the path to the second plugin is bugged. I wanted to move this to the server but with this option it will be really messy.
Beta Was this translation helpful? Give feedback.
All reactions
-
Use import os
and initialize the path of your extensions then concatenate your extensions with ',' in between in your extension_dir=
argument.
root = os.getcwd()
ext_10 = os.path.abspath(os.path.join(root, 'ext/ext1'))
ext_20 = os.path.abspath(os.path.join(root, 'ext/ext2'))
with SB(uc=True, extension_dir=f'{ext_10},{ext_20}') as sb:
Beta Was this translation helpful? Give feedback.
All reactions
-
@Vrackko is right about that .when there are multiple extensions to be loaded only the first one works and there is error for the rest but when we try to load them individually it works without any problem .tried with the absolute path as well but still not working
Beta Was this translation helpful? Give feedback.