How to load multiple unpacked extensions into webdriver?

394 views
Skip to first unread message

Michał Kuczma

unread,
Jun 2, 2022, 3:00:09 AM6/2/22
to Selenium Users
Perhaps a bug or something very unclear for me.

I try to load 2 UNPACKED chrome extensions using Selenium and python

I am stuck because below code adds only the last extension so one extension is added instead of two. SO this line is executed only:

```
options.add_argument("load-extension=/Users/path/Downloads/python/proj/folder/ext_2_folder")
```

What can be a reason of that?


```

from selenium.webdriver.chrome.service import Service
from selenium import webdriver

options = webdriver.ChromeOptions()


options.add_argument("load-extension=/Users/path/Downloads/python/proj/folder/ext_1_folder")
options.add_argument("load-extension=/Users/path/Downloads/python/proj/folder/ext_2_folder")
s = Service('/Users/path/Downloads/python/proj/folder/chromedriver')

driver = webdriver.Chrome(service=s, options=options)
driver.get("chrome://extensions")


```

David

unread,
Jun 2, 2022, 9:37:32 PM6/2/22
to Selenium Users

Michał Kuczma

unread,
Jun 7, 2022, 8:23:56 AM6/7/22
to Selenium Users
thanks Dawid

Michał Kuczma

unread,
Jun 16, 2022, 7:13:48 AM6/16/22
to Selenium Users
It does not seem to work.

```
options.add_argument("load-extension=/Users/User1/Downloads/python/projects/one/folder1, /Users/User1/Downloads/python/projects/one/folder2")

```

I am constanly getting the message that

Manifest file is missing while its there 100%

and it loads only the first extension

Anything wrong with the code above?

David

unread,
Jun 16, 2022, 12:54:40 PM6/16/22
to Selenium Users
You will need to debug the issue further. I see you put a space in between the two folders when providing as comma separated string/list. I believe per the StackOverflow posts, you do not add a space after the comma. Try that to see if it makes a difference.

Another thing to try, try running the Chrome browser with the command line argument/option to load both those extensions together, following the StackOverflow posts, instead of ChromeDriver, and see if that works. If it's broken with the Chrome browser directly, it's not going to work with ChromeDriver.

Aside from that, other possibilities to consider is trying with older (or newer?) versions of Chrome and/or ChromeDriver to see if it helps or not, in case some kind of version issue.

Michał Kuczma

unread,
Jun 16, 2022, 7:10:37 PM6/16/22
to Selenium Users
@Dawid - silly mistake - indeed removing a space between folders did the trick. Thanks for this

Sergei Nosov

unread,
Jun 17, 2022, 5:18:42 AM6/17/22
to Selenium Users
connect your browser profile to chromedriver:

chrome_options.add_argument(r"--allow-profiles-outside-user-dir")
chrome_options.add_argument(r"user-data-dir=C:\Users\User\AppData\Local\Google\Chrome\User Data")
chrome_options.add_argument(r"--profile-directory=Default")

четверг, 16 июня 2022 г. в 14:13:48 UTC+3, m...@meeffe.com:

Sergei

unread,
Jun 17, 2022, 5:19:16 AM6/17/22
to Selenium Users
connect your browser profile to chromedriver :)

четверг, 16 июня 2022 г. в 14:13:48 UTC+3, m...@meeffe.com:
It does not seem to work.

Michał Kuczma

unread,
Jun 17, 2022, 5:54:12 AM6/17/22
to Selenium Users
@Sergei 

It isn't necessary

Simple 

options.add_argument("load-extension=/Users/User1/Downloads/python/projects/one/folder1,/Users/User1/Downloads/python/projects/one/folder2")

did the trick.

Reply all
Reply to author
Forward
0 new messages