Definition of Mixed content
Mixed content occurs when initial HTML is loaded over a secure HTTPS connection, but other resources (such as images, videos, stylesheets, scripts) are loaded over an insecure HTTP connection. This is called mixed content because both HTTP and HTTPS content are being loaded to display the same page, and the initial request was secure over HTTPS.
Mixed content degrades the security and user experience of your HTTPS site.
Source: https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content?hl=en-us
How to detect mixed content
Modern browsers display warnings about this type of content to indicate to the user that this page contains insecure resources. So this means that it could be a good way to verify that your detection program is working correctly.
For example, on Chrome DevTools (F12), Network Tab, you are going to see a status of (blocked:mixed-content) for a request that is of unsafe content.
Detecting mixing content basically is detecting content that is loaded not using the HTTPS protocol, so checking for the tags that you mention is pretty easy, you can just run a regex or xpath to accomplish this. But the hard part is detecting dynamic loaded content (i.e. XMLHttpRequest calls). So, in this case you must actually wait for the javascript on the page to run. A tool like Selenium Web Driver http://www.seleniumhq.org/projects/webdriver/ that allows you to do browser automation in any of Java, C#, Ruby, Python, Javsascript languages could do the job.
As Detect broken SSL or insecure content warning with Selenium, BrowserStack, & Node.js suggests, a very simple script that just checks the Firefox WebDriver logs is an easy solution.