0

I wanted to add to my working program some code in order to open the chrome browser with an extension already enabled, but since I added it, the browser starts with the extension enabled and, instead of the target URL, it loads a blank page that has written just "data;" on the Url bar. I'm pretty sure that the problem is referred to the code I added to the previous program because, if I delete it, the program runs fine but without the extension.

from selenium import webdriver
import os
from selenium.webdriver.chrome.options import Options

executable_path = "path to the chromedriver"
os.environ["webdriver.chrome.driver"] = executable_path

buster = webdriver.ChromeOptions()    # buster is the extension I want to add
buster.add_extension('path to buster.crx')

driver=webdriver.Chrome(executable_path=executable_path, options=buster)
driver.maximize_window()
driver.get('https://stackoverflow.com/')
Drun
  • 529
  • 1
  • 7
  • 17

0 Answers0