I'm trying to pick out content from a div in an external html file. Here's the html code
<some html>
{<div id="responseDiv" style="display:none">
required content
</div>
</some html>
Here's the php code I'm using
include_once('simple_html_dom.php');
$curl_h = curl_init('http://www.example.com/');
curl_setopt($curl_h, CURLOPT_HTTPHEADER,
array(
'User-Agent: NoBrowser v0.1 beta',
)
);
curl_setopt($curl_h, CURLOPT_RETURNTRANSFER, true);
$handle = curl_exec($curl_h);
$html = str_get_html('$handle');
$ret = $html->find('div[id=DivID]');
foreach ($ret as $post)
{
echo $post->outertext;
}
I check around and found that $ret itself is an empty array. I have tried playing around with other div IDs etc but all to the same result. What am I doing wrong??