0

I'm trying to install a google chrome extension on a large amount of my desktop computers using python. I've gotten Selenium to open a simulated browser with the extension, but that doesn't actually download it to the computer, so that doesn't necessarily help. My current code is

import webbrowser

webbrowser.open_new_tab(
    "https://panelresearch.google.com/browser/extension/download")

This just opens the page where I can find the extension, can anyone show me a library where I can click buttons that are on this page? Additionally, I'll need to identify the extension popup and I realized that I cannot inspect any elements in that popup.

Dhiraj
  • 2,687
  • 2
  • 10
  • 34

1 Answers1

0

As far as I know, there is no way of operating the extension popup using any API other than simulating the clicking on OS level.

When you're testing an extension using Selenium, you have to specify a custom profile as an argument during the start of the process connected to the WebDriver. More info here or use a special ChromeDriver API.

If you just want to force install an extension in an enterprise/educational environment, you can follow this guide. You can also edit already existing profiles (to some extend and in my experience unreliably) by editing the Preferences file in the profile directory. Just make sure you have backups and an instance of Chrome is not running with that profile.

Good luck.

Somrlik
  • 680
  • 5
  • 13
  • Thanks for your information, I'm now trying to pursue the option expressed in your third paragraph, can you explain or throw down a link that I might be able to follow for editing existing `Preferences` files? – Tyler Richards Nov 05 '17 at 23:11