Combining CURL and simple html dom
Try changing this:
$html->load($curl_scraped_page);
To this:
$html->load($curl_scraped_page, true, false);
The problem is that simple_html_dom removes all \r \n by default and in this case it breaks javascript code since yahoo don't end it with a semicolon.
You can see this error at the browser console and you can also see that simple_html_dom removes linebreaks viewing the source.