parsing a website dynamically

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lmadan
Forum Newbie
Posts: 2
Joined: Sat Jun 20, 2009 5:59 pm

parsing a website dynamically

Post by lmadan »

Hi,


I am pretty new in PHP and want to parse a website on run time. So it's like if a user provides a website address and a keyword to look for, then i want to display the complete line and also some related information under that area.
For example: if the user provides the website address as:

http://www.amazon.com/Biology-Mastering ... 929&sr=8-1

and wants to find the ISBN10, ISBN13, Weight, Dimensions, and Current Price from the page...

Thanks for the help in advance....

Regards,
Lokesh
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: parsing a website dynamically

Post by Eric! »

At first it might seem difficult, but everything is difficult at first.

The approach to your problem:
Learn how to process forms with php
Learn how to read websites (fopen with url)
Learn how to search for matching strings (php string manipulation)
Learn how to parse the pieces you want (experiment on target sites)
Learn how to output your results in html friendly tags

Then as a bonus make sure you didn't make your site vulnerable to xss attacks.
lmadan
Forum Newbie
Posts: 2
Joined: Sat Jun 20, 2009 5:59 pm

Re: parsing a website dynamically

Post by lmadan »

Thanks a lot...... got the answers....
Post Reply