thinkaboutit Posted December 13, 2007 Share Posted December 13, 2007 I need to pull some data from various yellow page resources and need some kind of scraper to pull the data for export so I can parse it. Any ideas of any decent scripts out there that will help me achieve this? Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/ Share on other sites More sharing options...
Yesideez Posted December 13, 2007 Share Posted December 13, 2007 http://www.pictureinthesky.net/utils/ripper.php You mean anything like that? Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414149 Share on other sites More sharing options...
thinkaboutit Posted December 13, 2007 Author Share Posted December 13, 2007 What I need to do is for an example pull company names, addresses and phone numbers from a yellow page web site such as yellow pages .com by category and location. Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414161 Share on other sites More sharing options...
phpSensei Posted December 13, 2007 Share Posted December 13, 2007 http://webscripts.softpedia.com/script/PHP-Clases/PHP-Scraper-19889.html Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414164 Share on other sites More sharing options...
thinkaboutit Posted December 13, 2007 Author Share Posted December 13, 2007 Right on - thanks a lot. Appreciate it. Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414168 Share on other sites More sharing options...
phpSensei Posted December 13, 2007 Share Posted December 13, 2007 Glad we can help Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414169 Share on other sites More sharing options...
thinkaboutit Posted December 13, 2007 Author Share Posted December 13, 2007 Last question... At least I hope. I ran a test scrap on the following using the following code which isn't spitting out anything. Hmmm... I test it with the Yahoo Finance and it works fine. Suggestions? <? require_once ("class_scraper.php"); // Get html -------- $o_sc = new scraper(); $s_html = $o_sc->fetch("http://www.magicyellow.com/category/General_Contractors/Denver_CO.html"); // Delimit start and end of patterns $s_start_pattern = "<td class"; $s_end_pattern = "</td>"; // Pattern structure $s_model = '<tr <td class="lName" colspan=2 width="100%"> <field> </td> <strong style="font-size: 11px;"> <field> </strong> <td colspan=2> <field> <br> '; $a_result = $o_sc->extract($s_html, $s_start_pattern, $s_end_pattern, $s_model); print_r ($a_result); ?> Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414196 Share on other sites More sharing options...
thinkaboutit Posted December 13, 2007 Author Share Posted December 13, 2007 To give you a brief run down - I am interested in pulling all the data below for each individual listing: This is from the following page: http://www.magicyellow.com/category/General_Contractors/Denver_CO.html. What my ultimate goal here is to have it auto populate listings based upon category and location. ??? <tr valign="top"> <td class="lName" colspan=2 width="100%"> SPECTRUM GENERAL CONTRACTORS </td> <td rowspan="2" align="right" nowrap> <strong style="font-size: 11px;">303-329-8003</strong> <br> <br><a href="/review.cfm?MYID=14231297" title="Write a review for SPECTRUM GENERAL CONTRACTORS"><img src="/writeAreview.gif" width="76" height="12" alt="" border="0"></a> </td> </tr> <tr> <td colspan=2> 5135 E 38th Ave<br> Denver, CO 80207 </td> </tr> Link to comment https://forums.phpfreaks.com/topic/81558-php-web-scraper/#findComment-414211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.