Scrape the data in PHP

 How to Scrape the data form website using CURL?  
 To scrap the data from website, Website must be public and open for scrapable.  
 In the following code, just update the URL to which websites data you want to scrap.  
 <?php  
 $s = curl_init();  
 curl_setopt($s,CURLOPT_URL,"http://www.domain_name.com/");  
 curl_setopt($s,CURLOPT_RETURNTRANSFER,1);  
 curl_setopt($s,CURLOPT_HEADER,0);  
 $op = curl_exec($s);  
 curl_close($s);  
 echo $op;  
 ?>  

Comments

Post a Comment

Popular posts from this blog