Thread: preg_match_all
View Single Post
Old 04-04-2008, 10:46 PM   #1 (permalink)
crazyryan
The Contributor
 
Join Date: Dec 2007
Posts: 27
Thanks: 0
crazyryan is on a distinguished road
Default preg_match_all

Hey, I'm trying to get data from retailmenot.com

This is what I have:

PHP Code:
<?php
if(isset($_GET['domain'])) {
    
$page file_get_contents("http://www.retailmenot.com/view/" $_GET['domain'] . "");
    
preg_match_all('/<a name="(.*)"><\/a><div class="coupon" id="(.*)"><table class="details"><tr><th class="code">Code:<\/th><td class="code" id="(.*)"><strong>(.*)<\/strong> <a class="useButton" href="\/out\/(.*)" target="_blank" onclick="javascript:pageTracker._trackPageview(\'\/outgoing\/aff\/(.*)\');" rel="nofollow"><span>Use coupon &raquo;<\/span><\/a><div class="affTracker"><\/div><\/td><\/tr><tr><th>Discount:<\/th><td class="discount">(.*)<\/td><\/tr><tr><th>Stats:<\/th><td class="stats"><span class="good">(.*)<\/span>/'$page$output);
    
print_r($output);
    } else {
}
?>
But when $_GET['domain'] = namecheap.com or any other data, I still get no data scraped..

Any ideas?
crazyryan is offline  
Reply With Quote