Guest User

curl_scraper.php

a guest
Aug 13th, 2011
135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. $url = "huntersandgatherers.jobamatic.com/a/jobs/find-jobs/l-07410/sb-pd/pn-1";
  3. $ch = curl_init($url);
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  5. $curl_scraped_page = curl_exec($ch);
  6. curl_close($ch);
  7. //echo $curl_scraped_page;
  8.  
  9. //$php_scraped_page = file_get_contents("http://huntersandgatherers.jobamatic.com/a/jobs/find-jobs/l-07410/sb-pd/pn-1");
  10.  
  11. //scarping location
  12. $location= '/location (.+?)/';
  13. preg_match($location,$curl_scraped_page,$scraped_location_data);
  14. var_dump($scraped_location_data);
  15. echo $scraped_location_data[1];
  16. ?>
RAW Paste Data