Someone wrote me this piece of code a while ago for extracting a certain element(/data) of a website:
$(function(){
var site = 'http://www.telegraaf.nl';
$.get('proxy.php', { site:site }, function(data){
var href = $(data).find('h2').first().children(':first-child').prop('href');
var url = href.split('/');
href = href.replace(url[2], 'telegraaf.nl');
$('.myDiv').html('<a href="' + href + '" target="_blank">' + href + '</a>');
}, 'html');
});
It works well but not on this dutch news site: http://www.telegraaf.nl
Can someone explain to me why that is, what is so special about this website? What do I have to change to make it work?