OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Scraper not working
This page's ID:
32442
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I'm not getting any errors. It just isn't working. [code] <? $html = file_get_contents("http://www.yellowpages.com/fort-lauderdale-fl/acupunture"); preg_match_all( '/ <div class="listing_content">.*? <h3 .*?> <a .*?>(.*?)<\/a> <\/h3> <span class="listing-address adr"> <span class="street-address">(.*?)<\/span> <span class="city-state"> <span class="locality">(.*?)<\/span>, <span class="region">(.*?)<\/span> <span class="postal-code">(.*?)<\/span> <\/span> <\/span> <span class="business-phone phone">(.*?)<\/span>.*? <li><a href="(.*?)">/s', $html, $posts, PREG_SET_ORDER ); $listing=array(); foreach ($posts as $post) { $listing['title'][] = $post [ 1 ]; $listing['street'][] = $post [ 2 ]; $listing['city'][] = $post [ 3 ]; $listing['state'][] = $post [ 4 ]; $listing['zip'][] = $post [ 5 ]; $listing['phone'][] = $post [ 6 ]; $listing['website'][] = $post [ 7 ]; // do something with data echo $post [ 4 ]; } print_r($listing) ?> [/code] [small](Edited by [url=http://www.ozoneasylum.com/user/7581]PixelMamma[/url] on 11-09-2011 22:08)[/small] [small](Edited by [url=http://www.ozoneasylum.com/user/7581]PixelMamma[/url] on 11-09-2011 22:11)[/small] [small](Edited by [url=http://www.ozoneasylum.com/user/7581]PixelMamma[/url] on 11-09-2011 22:12)[/small] edit Tyberius prime: added code tags [small](Edited by [url=http://www.ozoneasylum.com/user/1424]Tyberius Prime[/url] on 11-10-2011 16:55)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail