Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to access IFrame in php
    text
    copied!<p>I have one website,from that website i want to download <code>iframe</code> contain. </p> <p>that is </p> <pre><code>&lt;iframe frameborder="no" align="center" width="100%" height="500px" style="width: 100%; height: 500px" name="FRAME1" src="/CWRWeb/nova/jsp/reports/running.jsp"&gt;&lt;/iframe&gt; </code></pre> <p>In this iframe data is present.</p> <p>Using <code>PHP Scriptable Web Browser</code> i am able to get that page. but i am not able to access iframe data.</p> <p>so i tried <a href="https://stackoverflow.com/questions/16668111/how-to-get-iframe-content-from-a-remote-page">this</a> but i not got.</p> <p>Here is my code:</p> <pre><code>&lt;?php require_once('simpletest/browser.php'); $browser = new SimpleBrowser(); $browser-&gt;get('https://www.mywebsite.com'); $browser-&gt;setField('userID', 'abc'); $browser-&gt;setField('passwd', 'abc123'); $log=$browser-&gt;click('login'); $browser-&gt;setCookie('xx','12345'); $browser-&gt;setCookie('pqr','dsw1278'); echo $log; /* suceessful login */ /* next page which has paremeter to be set */ $parameters = array ( "fromMonth"=&gt;"NOV", "fromDay"=&gt;"05", "fromYear"=&gt;"2013", "toMonth"=&gt;"NOV", "toDay"=&gt;"05", "toYear"=&gt;"2013", ); $browser-&gt;post('https://www.xxxx.com/Web/download.do?',$parameters); /*page where iframe is present */ /* here i want to access my iframe so i used */ $ch = curl_init(); // Set url and other options curl_setopt($ch, CURLOPT_URL,"/CWRWeb/nova/jsp/reports/running.jsp"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Get the page contents $output = curl_exec($ch); echo $output; // close curl resource to free up system resources curl_close($ch); ?&gt; </code></pre> <p>can any one tell me which is the best way to get iframe data.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload