I am trying to scrape comments that are generated via iframe from another domain. When I am trying to do so I am either getting a null message that says this application is not registered.I do understand that this is due to cross domain issues.I have written the following code in php using Curl.When i pass the parent url it loads the page but the content under the iframes are missing and when i pass the child url,it returns a message saying application not registered.
Code:
<?php
// 1. initialize
$ch = curl_init();
// 2. The URL containing the iframe
$url = "http://www.ndtv.com/india-news/1993-mumbai-blasts-convict-yakub- memons-final-mercy-plea-rejected-783656?pfrom=home-lateststories";
// 3. set the options, including the url
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// 4. execute and fetch the resulting HTML output by putting into $output
$output = curl_exec($ch);
// 5. free up the curl handle
curl_close($ch);
// 6. Scrape for a single string/word ("Paris")
preg_match("~</?p[^>]*>~", $output, $match);
if($match)
// 7. Display the scraped string
echo $output;
?>
The child url for iframe is
Is there any way by which I can access the iframe content.I want this data form analysis and not for any illegal usage.
Thanks for the help in advance.