Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-29-2008, 08:43 AM Content Scraping
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
I would like to scrape 4 items from a certain page. I have managed to get one but how do i get all four? Here is the code i used:

Quote:
$data = file_get_contents('http://mywebsite.htm');
$regex = '/<div align="right" class="style13">(.*?)<\/div>/';
preg_match($regex,$data,$match);
var_dump($match);
echo ('<h1>' . $match[1] .'</h1>');
the other 3 is also appears after the <div class="style13">
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
 
Register now for full access!
Old 10-29-2008, 10:36 PM Re: Content Scraping
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
I had similar question.

Check
http://www.webmaster-talk.com/php-fo...d-content.html

Might shed some light.
__________________
Websites Created;
warscope.com
ratepayers.org.nz
lothop is offline
Reply With Quote
View Public Profile
 
Old 10-30-2008, 12:46 AM Re: Content Scraping
vn5ltr's Avatar
Skilled Talker

Posts: 93
Location: Melbourne, Australia
Trades: 0
Have you tried preg_match_all?
vn5ltr is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Content Scraping
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36654 seconds with 12 queries