i used several method html content of aptoide.com in php.
1) file_get_contents();
2) readfile();
3) curl php function
function get_dataa($url) { $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_binarytransfer, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_useragent, "mozilla/5.0 (compatible; konqueror/4.0; microsoft windows) khtml/4.0.80 (like gecko)"); $data = curl_exec($ch); curl_close($ch); return $data; } 4)php simple html dom parser
include_once('simple_html_dom.php'); $url="http://aptoide.com"; $html = file_get_html($url); but of them give empty output aptoide.com there way full html content of url ?
echo file_get_contents('http://www.aptoide.com/'); works fine me.
so it's possible aptoide.com has been blocked you. if want change ip (as said in comment) have use this:
$url = 'http://aptoide.com.com/'; $proxy = '127.0.0.1:9095'; // proxy // $proxyauth = 'user:password'; // proxy authentication if required $ch = curl_init(); curl_setopt($ch, curlopt_url,$url); curl_setopt($ch, curlopt_proxy, $proxy); //curl_setopt($ch, curlopt_proxyuserpwd, $proxyauth); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_header, 1); $curl_scraped_page = curl_exec($ch); curl_close($ch); echo $curl_scraped_page;
Comments
Post a Comment