As mentioned earlier, you cannot get the contents of an <iframe> if its source is not from a single source.
This also applies to most other methods of obtaining external content, for example, using ajax to download source code from another page. i.e.: $('#div').load('http://www.google.com');
To download external content, the content must comply with the same origin policy.
This means that the content must be on the same protocol and host.
Wikipedia article related above:
httpː // www.example.com / dir / page2.html → Success The same protocol and host
httpː // www.example.com / dir2 / other.html → Success The same protocol and host
httpː // username: password@www.example.com/dir2/other.html → Success The same protocol and host
httpː // www.example.com: 81 / dir / other.html → Failed. The same protocol and host, but a different port
https://www.example.com/dir/other.html -> Failure Various Protocols
http://en.example.com/dir/other.html → Miscellaneous Host Failure
http://example.com/dir/other.html -> Failure Various hosts (exact match required)
http://v2.www.example.com/dir/other.html → Failure Various hosts (exact match required)
Simply put, it should be on the same site. Therefore, while example.com/hello.html can download content from example.com/goodbye.html , it cannot download content from google.com/content.html
In addition, it must be in the same domain. Subdomains are considered VOIDs by the same domain policy, so while weebly.com/hello.html can download content from weebly.com/goodbye.html , it cannot download content from user1.weebly.com/content.html
There are, of course, workarounds, as usual, but this other story is all together. Actually, this is very relevant for the issue. So, here is a wonderful thread topic on all its routes.