1

i want it can load and enable the flash in --incognito mode. but i have no idea how to make it.

DETAILS: i use selenium python for chromedriver. there's a website with video area need loading flash. here's my code, when i active --incognito mode, though the page load the flash succesfully, then i must click the video area to enable it. if do not active --incognito mode, the video can be shown automatically.

from selenium import webdriver
driver_options = webdriver.ChromeOptions()
# driver_options.add_argument("--incognito")
driver_options.add_argument("--start-maximized")
driver_options.add_argument(r"--ppapi-flash-path=path of pepflashplayer.dll")
driver_options.add_argument("--ppapi-flash-version=29.0.0.113")
driver_options.add_argument("--disable-bundled-ppapi-flash")
prefs = {
    "profile.default_content_setting_values.plugins": 1,
    "profile.content_settings.plugin_whitelist.adobe-flash-player": 1,
    "profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player": 1,
    "PluginsAllowedForUrls": "url"
}
driver_options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(executable_path=r'path of chromedriver',
                      chrome_options=driver_options)
driver.get("url")
baozugong
  • 11
  • 3
  • i try different situations, and discover it can not enable the flash with selenium chromedriver in --incognito mode ( even i click the video area, it just refresh the page without enable flash ), but can if i open incognit window from chrome.exe and click video area. i hope it can load and enable the flash automatically in --incognito mode with selenium. – baozugong Apr 01 '18 at 16:46

0 Answers0