Last active
August 29, 2015 14:01
-
-
Save mayeenulislam/6827c8445ee202bf1a09 to your computer and use it in GitHub Desktop.
Grabbing a complete website usig cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Assisted by Mr. Ariful Haque */ | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, 'http://www.oilprice.com'); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); | |
$content = curl_exec($ch); | |
$dom = new DOMDocument(); | |
$dom->loadHTML( $content ); | |
// Parse the dom for your desired content | |
print_r($dom); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment