mini_ Posted April 1, 2007 Share Posted April 1, 2007 If you look on http://www.amazon.com/gp/bestsellers/music/ref=pd_ts_c_th_head/002-5957247-9688012?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=right-4&pf_rd_r=1GH6HBJ7B31EPCC5K6XK&pf_rd_t=101&pf_rd_p=259704501&pf_rd_i=5174 it shows the best sellers music albums om amazon.com Is it possible to use some kind of regexp to parse out the top 25 list shown on the page? Have been trying for the hole day without any success Any help at all would make me very glad Quote Link to comment Share on other sites More sharing options...
effigy Posted April 2, 2007 Share Posted April 2, 2007 <pre> <?php $url = 'http://www.amazon.com/gp/bestsellers/music/ref=pd_ts_c_th_head/002-5957247-9688012?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=right-4&pf_rd_r=1GH6HBJ7B31EPCC5K6XK&pf_rd_t=101&pf_rd_p=259704501&pf_rd_i=5174'; $page = file_get_contents($url); preg_match_all('%<strong.+?><a.+?>([^>]+)</a></strong>\s*<br />\s+~\s+((??!\(Artist\))[^<])+)%', $page, $matches, PREG_SET_ORDER); // Toss full matches. foreach ($matches as &$match) { array_shift($match); } print_r($matches); ?> </pre> Quote Link to comment Share on other sites More sharing options...
mini_ Posted April 3, 2007 Author Share Posted April 3, 2007 Thanks a lot ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.