Open lincolnaleixo opened 8 years ago
get the url of the iframe and load it directly.
There's no url on the iframe
If iframe has srcdoc element you can get data with this code.
$doc = new DOMDocument();
$doc->loadHTML($yoursiteHTML);
foreach($doc->getElementsByTagName('iframe') as $link) {
echo $link->getAttribute('srcdoc');
}
If you want to get you can get data with this code.
$doc = new DOMDocument();
$doc->loadHTML($yoursiteHTML);
foreach($doc->getElementsByTagName('iframe') as $link) {
echo $link->nodeValue;
}
but if iframe content is loading from external source, it does not work.
Hey,
I want to extract information from a site that has content inside an iframe, I tried to copy the XPath but didn't return anything. Is there any way I can get this content?
Regards