xPulsarx Posted March 16, 2009 Share Posted March 16, 2009 Hi Guys, I'm working ona website at the moment thats like a "search" enging type website, just an idea i have in my head but in order to do that I need this site to "Parse" data from another website. I have been told that PHPQuery is so far the best one to use. I have managed to parse data from eBay quite easily but when it comes to a site like this.. www.dstore.com.au It has been hard, there code is so messy I don't know how they can run it like that, mentioning that, I've seen worse... Basically if you look at this.. http://dstore.com.au/home/search/quick/100,0,12,00.html?search_term=Jim+Beam&utm_campaign=dStoreSearch&ps=1 I want to be able to grab the ( Picture, Link, Title & Price ) Using PHPQuery atm, I am doing this $dstoreprod = $dstore->find( "table.top_panel + div table" ); $dstoreprod = $dstoreprod->find( "table table[cellspacing=0]" ); $dstoreprod = $dstoreprod->find( "tr" ); $dstoreprod = $dstoreprod->slice( 1, 6 ); foreach ( $dstoreprod as $row ) { $image = pq( $row )->find( "td a img" )->attr( "src" ); $title = pq( $row )->find( "td a strong" )->text(); $title_link = pq( $row )->find( "td a" )->eq( 1 )->attr( "href" ); $price = pq( $row )->find( "td[valign=middle]")->text(); echo "<img src=\"". $image ."\"></img> "; echo "<a href='" . $title_link ."'>". $title ."</a>"; echo "  $price"; echo "<br />"; } However it isn't working, I have tried many different routines and still cannot get it to work.. I guess my main question actually is, am I missing something? or is there an easier way to grab this sort of information from websites? Thanks. Link to comment https://forums.phpfreaks.com/topic/149635-phpquery-parsing-data/ Share on other sites More sharing options...
xPulsarx Posted March 17, 2009 Author Share Posted March 17, 2009 No-one has any ideas? Link to comment https://forums.phpfreaks.com/topic/149635-phpquery-parsing-data/#findComment-786527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.