Adding Chrome extension in Selenium / Python / Ubuntu



  • I am having problems in adding extensions in Chrome before Selenium tests, using Python.

    On the code side, it's pretty simple:

    options = Options()
    options.add_extension(/path/to/extension)
    webdriver.Chrome(options = options)
    

    The problem is in finding the path. The folder where my extensions are stored is the following:

    enter image description here

    Even inside each folder I have no clue of the extension itself.



  • Under Linux your home-dir is /home/username/

    So from your screenshot I would expect the path to be:

    /home/username/.config/google-chrome/Default/Extensions/extensions-id
    

    Each directory in your screenshot is an extension. You could copy the extension to a path you do know. Just copy the directory with the right ID. You can find the ID's in the Chrome extension manager. Surf too chrome://extensions/?id= +id to check if it is the right one.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2