Google Search Parser

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
jankidudel
Forum Commoner
Posts: 91
Joined: Sat Oct 16, 2010 4:30 pm
Location: Lithuania, Vilnius

Google Search Parser

Post by jankidudel »

Hello, I'm making something like crawler or so, and I have little problems which I can't solve myself, so I think maybe you can.

here is URL, i must insert keyword like any interested word to be searched and then retrieve all the divs from this site
http://www.google.com/search?hl=en&sour ... q=$keyword
and save to webpage. I thought it's easy to find <div class='div_name' for beginning of the div and the end but, it's harder because they are different and I can't search all the matchings for 1 pattern. Div must contain these kind of thinhs:
Div title
Div snippet

I know it's must be easy but i'm struck.

Example :
$keyword = 'Michael Jordan'

then 1 div must containt this:
Div title = Michael Jordan - Wikipedia, the free encyclopedi
Div snippet = Michael Jeffrey Jordan (born February 17, 1963) is a former American professional basketball player, active businessman, and majority owner of the Charlotte ...


Thank you very much.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Google Search Parser

Post by Jonah Bron »

Sorry, scraping is against Google's Terms of Service. More here:

http://www.google.com/accounts/TOS
Post Reply