How to get Iframe which is loaded via JS?

Make the curl request, get a successful result:
$result = curl_exec($ch);
Then, this result I decided to print using var_dump($result); - checked, that's it!
Wanted to get iframe data using DOMDocument, but face the problem that they do not find this information!
After some thought I came to the conclusion that Iframe as I understand it is generated via JS scripts when the page loads, so when I print var_dump I see the desired iframe.

Decided to do the following: Using file_put_contents recorded $result to a file, which as you already know, I did not find iframe.
Here is the html which is printed with var_dump:
spoiler
<html lang="en"><head>
 <meta charset="utf-8">
 <link rel="shortcut icon" href="https://static/16May2019/images/favicon.ico" type="image/X-icon">
<title>Login</title>
 <meta name="viewport" content="initial-scale=1.0">
 <meta name="Description" content="Login">
 <meta name="Title" content="Login">



<link rel="stylesheet" type="text/css" href="/styles/ac-globalfooter.built.css">




 <script type="text/javascript" src="/jsapi/authService.latest.min.js"></script><style type="text/css"></style>
 <script src="views/static/js/retina.js" type="text/javascript" charset="utf-8"></script>
 <link rel="stylesheet" type="text/css" href="static/16May2019/views/static/css/login/embedLogin.css">

 <link rel="alternate" hreflang="x-default" href="">

</head>
<body data-theme="gray" style="background-color: #FFFFFF">

<div class="wrapper-window" style="background-color: #FFFFFF">
 <div id="auth-container" class="si-frame">
 <iframe src="https://123.ru/signin?widgetKey=16452abf721961a1728885bef033f28e&language=RU-RU&iframeId=auth-9e8cjizh-z8hn-7a24-w6cu-19pqe9cz&appId=632" width="100%" height="100%" id="aid-auth-widget-iFrame" name="aid-auth-widget" scrolling="no" frameborder="0" role="none" title=" Login"></iframe>
</div>


 <script type="text/javascript">
 var dawSomething is wrong = {};
 dawSomething is wrong = {"appId":632,"appCustomAttributes":{"showIDLogo":false,"widgetMode":"inline","showRememberMe":true,"enableKeepMeSignedIn":false,"showCreateLink":true,"logoWidth":"auto","showGlobalNav":false,"showGlobalFooter":true,"hideContrySelector":true,"openIDLinksInNewWindow":true,"prePopulateId":false,"myAccessCreateLink":false,"disableiForgotReturnUrl":false,"rememberMeChecked":false,"enableEyebrowTextbox":true}};
 dawSomething is wrong.signInString = encodeURI("Input");
 dawSomething is wrong.accountName = encodeURI("");

 var logoSrc = dawSomething is wrong.appCustomAttributes.logoImage;
 if (logoSrc != undefined) {
 logoSrc = 'https://123.ru' + dawSomething is wrong.appCustomAttributes.logoImage
}

 /** logoImage update for Retina cases **/
 if (isRetina() == true) {
 logoSrc = replace2XImage(logoSrc);
}

 /** logoWidth adjustments for retina image*/
 var logoWidth = dawSomething is wrong.appCustomAttributes.logoWidth;
 if (logoWidth != undefined && logoWidth != 'auto') {
 if (isRetina()) {
 logoWidth = logoWidth * 2;
}
 logoWidth = logoWidth + 'px';
}

 /** Return the URL of the DAW Version **/
 var returnUrlVersion = '1';
 if (returnUrlVersion != undefined && returnUrlVersion == '0') {
 returnUrlVersion = '1';
}

 window.onload = function () {
 var initOpts = {
 serviceKey: '16452abf721961a1728885bef033f28e',
 serviceURL: 'https://123.ru/auth',
 containerId: 'auth-container',
 devAppDomain: ",
 authUIMode: 'window',
 locale: 'EN-us',
 requestorAppId: '632',
 theme: 'dark',
 signInLabel: decodeURI(dawSomething is wrong.signInString),
 appName: '',
 createLinkText: ",
 returnUrl: decodeURIComponent('https'),
 accountName: decodeURI(dawSomething is wrong.accountName),
 signInPageURL: decodeURIComponent('https%3A%2F%2F123.ru%2Fsignin%3Flanguage%3DRU-RU%26rv%3D1%26path%3D%252Faccount%252F%26Env%3DUAT%26appIdKey%3D891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757'),
 createLinkUrl: decodeURIComponent("),
 alternateTokenCookie: false,
 font: 'sf',
 verificationToken: "",
 logo: {
 src logoSrc,
 width: logoWidth,
 url: dawSomething is wrong.appCustomAttributes.logoTargetUrl
},
 requestorAppParams: {
 serviceKey: '891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757',
 domainId: returnUrlVersion,
 baseURL: ",
 path: '/account/'
},
 features: {
 rememberMe: dawSomething is wrong.appCustomAttributes.showRememberMe,
 selectRememberMe: dawSomething is wrong.appCustomAttributes.rememberMeChecked,
 createLink: dawSomething is wrong.appCustomAttributes.showCreateLink,
 openIDLinksInNewWindow: dawSomething is wrong.appCustomAttributes.openIDLinksInNewWindow,
 useEyebrowTextbox: dawSomething is wrong.appCustomAttributes.enableEyebrowTextbox.toString().toUpperCase() === 'TRUE' && location.search.split('?').pop(0).split('&').indexOf('eyebrow=true') > -1
},
 callbacks: {
 onAuthSuccess: function (opts) {
 if(typeof opts.rememberMe == 'undefined'){
opts.rememberMe=false;
}
 document.getElementById('rememberMe').setAttribute('value', opts.rememberMe);
document.getElementById('callBackForm').submit();
}
}
};
window.ID.service.auth.init(initOpts);
};

</script>
</div>

<form id="callBackForm" name="form1" style="display:none" action="signin" method="post">
 <input type="hidden" id="rememberMe" name="rememberMe" value="false">

 <input type="hidden" id="requestUri" name="requestUri" value="/signin">






 <input type="hidden" id="appIdKey" name="appIdKey" value="891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757">


<input type="hidden" id="language" name="language" value="EN-us">


 <input type="hidden" id="path" name="path" value="/account/">



 <input type="hidden" id="rv" name="rv" value="1">









<input type="hidden" id="scnt" name="scnt" value="05b9bf1221b2b673706ccb3ce5b7399d">
</form>




<style>
 @media only screen and (min-device-width: 481px) {
 .wrapper {
 margin-bottom: -66px;
 padding-bottom: 66px;
}
}

 @media only screen and (max-device-width: 480px) {
 .wrapper {
 margin-bottom: -122px;
 padding-bottom: 122px;
}
}
</style>


<footer lang="EN-us" aria-labelledby="ac-gf-label" role="contentinfo" data-analytics-region="global footer" class="js no-touch svg no-oldie no-ie standard-footer" id="ac-globalfooter">
 <div class="ac-gf-content">
 <section class="ac-gf-footer">

 <div class="ac-gf-footer-locale">





</div>
 <div class="ac-gf-footer-legal">
 <div class="ac-gf-footer-legal-copyright">
Text
</div>
 <div class="ac-gf-footer-legal-links">
 <a class="ac-gf-footer-legal-link" href="/privacy-policy/ " target="_blank">
 Privacy policy
</a>
 <a class="ac-gf-footer-legal-link" href="/legal/terms/site.html" target="_blank">
 Terms of use
</a>

</div>
</div>
</section>
</div>
</footer>

There are some options still to iframe field?
March 23rd 20 at 18:56
1 answer
March 23rd 20 at 18:58
Actually a strange question.
the iframe is loaded by the browser without any JS on the basis of the parameter src. That is, You to get the content of the iframe need to get a reference from it
https://123.ru/signin?widgetKey=16452abf721961a1728885bef033f28e&language=RU-RU&iframeId=auth-9e8cjizh-z8hn-7a24-w6cu-19pqe9cz&appId=632
and load it with content.
My question is exactly how to get the src if the iframe is created with javascript-AMI??? I.e. again explain:
When I do var_dump I can see in the iframe code, because the js are apparently, but if I do just save the html page to a file using file_put_contents I don't see the iframe even!! because js scripts are not executed, they are simply evening training session, but nobody was performed by the string iframe is not formed (does not exist in html code) to do something for nothing, although to get it easily.

In fact I need to completely pull or link the iframe, (best option) or some way toiframeId=auth-9e8cjizh-z8hn-7a24-w6cu-19pqe9cz which apparently is generated by the scripts just yet.
I hope someone can help with this very simple question, for now authorization on many websites implemented that way... - Pamela.Leffle commented on March 23rd 20 at 19:01

Find more questions by tags PHP