I want to be able to get the complete source code from a webpage, I tried the method mentioned here It does not grab all the source code for the page I want the code from.
The page got several iframes each with a "virtual tag" #document and everything after that tag I can not get.
If I just right-click the page in Chrome and select view-source the code after the #document is not visible there either. However, if I inspect the page using Chrome I can see all the source code after the #document tag too.
I looked at this post on SO but it does not help me either. I can actually see the first part of the code in the iframes, just nothing after the #document. It looks structually like this:
<iframe class="xxxxx" frameborder="0" scrolling="no" srcdoc="<html
<base target="_parent">
<head>
<style> body { display: none; } </style>
</head>
<body>
<style> </style>
</body>
</html>">
#document
<!-- code I can not reach -->
<html><head></head><body>...</body></html>
</iframe>
I tried to iterate through all the iframes in DOM using javascript but then I just get a security error which from what I read can not be worked around:
SecurityError: Blocked a frame with origin "http://www.google.com" from accessing a cross-origin frame.
Is there a way to do what I want? I mean, Chrome can see this source code through the Inspect function so it must be possible in some way.