I have tried both file_get_contents and CURL to fetch the content of a specific page. I setup the CURL to follow redirects and changed User-Agent
, however, it did not work. I have no problem when loading page in browser. I get a page with below code whenever I try to fetch it with file_get_contents or CURL:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Loading ...</title> <script
src="/jquery.js" type="text/javascript"></script> </head> <html> <noscript>Enable java!</noscript> <div id="status"></div> <script type="text/javascript">
function check(){ $.ajax({
type: "POST",
url: "/index.php",
data: "allowed=5b91b80a061537ae6a23835aba38279e",
success: function(html){if(html == "allowed"){location.reload();}},
beforeSend:function(){
$("#status").html("Loading ...")
}
});
}
$(document).ready(function(){
check();
});
</script> </html>
Is there anyway to bypass such restriction without using Javascript based Web Scrapers like PhantomJs, CasperJs or ZombieJs? Simply using a plain PHP?