Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13861

Selenium Headless Mode Issue with Chrome Extension Rendering

$
0
0

Encountered a problem with Selenium in headless mode where Chrome extension page wouldn't render, resulting in blank screenshot. Disabling headless mode fixed the issue. Seeking a solution to render extension page while in headless mode.

from selenium import webdriverfrom selenium.webdriver.chrome.service import Servicefrom webdriver_manager.chrome import ChromeDriverManageroptions = webdriver.ChromeOptions()options.add_extension("ext.crx")options.add_argument("--window-size=1920,1080")options.add_argument("--no-sandbox")options.add_argument("--disable-dev-shm-usage")driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)driver.get("chrome-extension://*****/popup.html")driver.save_screenshot('1.png')driver.quit()

I expected Selenium to successfully render the Chrome extension page in headless mode and capture screenshots of the pages as they appeared.


Viewing all articles
Browse latest Browse all 13861

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>