Search code examples
pythonseleniumfirefoxflashfirefox-profile

Python: How to automate 'Allow' flash player content in Firefox?


I need to allow flash content in an automated manner in Python. I tried using Selenium in Python to do so but could not manage. The issue is that browsers stopped supporting settings that always allow flash content. Moreover, the "Allow" button cannot be accessed via Selenium for instance because it is not a part of the website or a setting in Firefox. Does anyone know about a potential workaround?

Here is an image of the Firefox message that I need to somehow access: https://i.sstatic.net/VYuRV.png


Solution

  • "...The Allow button cannot be accessed via Selenium for instance because it is not a part of the website or a setting in Firefox. Does anyone know about a potential workaround?"

    I don't know your OS but if it was my problem...

    • Try to find a "key press" module to send the A key press into Firefox (ie: the Allow shortcut).

    • Try to send a mouse-click at the coordinates of Allow button.

    A good option to try is pyautogui. Once Flash is enabled by such module (clicker or presser) then you can involve Selenium for whatever you needed to do in the enabled Flash.