TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-05-2008, 03:53 AM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default all about parsing

hi, where can i learn all about webpage parsing?

for example
i had a variable that went to dictionary.com and grabbed the word and definition and stored it into the database

something like that
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 02-05-2008, 05:29 AM   #2 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

something i been wanting to look into myself.
CoryMathews is offline  
Reply With Quote
Old 02-05-2008, 11:01 AM   #3 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

Looks up the libcurl package php.net/curl and look into regex and that should get you on your way
TlcAndres is offline  
Reply With Quote
Old 02-05-2008, 05:12 PM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Using regular expressions isn't necessarily the best, or easiest, method of grabbing content from HTML pages. Another alternative might be to use the DOM classes, perhaps in conjunction with XPath, to grab the required parts of the HTML documents.
Salathe is offline  
Reply With Quote
Old 02-05-2008, 09:47 PM   #5 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

I find simple XML very easy.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 02-06-2008, 02:25 PM   #6 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

I wouldn't be using XML for parsing webpages to fetch a word like that, as if theres an XML parse error the script fails to solve your problem.

Personally I would use the string functions or regular expressions to match the markup where the data I would like to fetch exists. I've done this quite a few times when I needed to fetch online status on variously skinned forums to get my online status and such.

But in the end it depends on what you want to grab ;)
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 11:43 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design