[Python] Loading unpacked Chrome extension with Selenium 4.34.2

Discussão em 'Python' iniciado por Stack, Julho 30, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to load an unpacked Chrome extension that is stored (as an unpacked folder) in the same folder where my script is running. This is the extension.

    import time
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    from selenium.webdriver.chrome.service import Service

    unpacked_extension_path = 'Pano-fetch'

    chrome_options = Options()
    service = Service("/usr/bin/chromedriver")

    chrome_options.add_argument('--load-extension={}'.format(unpacked_extension_path))
    chrome_options.add_experimental_option("detach", True)

    driver = webdriver.Chrome(service=service, options=chrome_options)

    driver.get("https://www.google.com/maps")

    time.sleep(10)


    So far, the code opens Chrome, I click Accept Terms & Conditions and Google Maps is loaded. However, I can't see the extension in the upper bar, where it usually should be.

    I am running Chrome version 138.0.7204.100 on Ubuntu 24.04

    Continue reading...

Compartilhe esta Página