(PHP) How to parse URLs in google search results?

我怕爱的太早我们不能终老 提交于 2019-12-06 07:47:55

Are you trying to search google.com. Looks like that class is for Google Base, not google.com search engine. http://base.google.com/support/bin/answer.py?hl=en&answer=59260

You probably want this: http://code.google.com/apis/customsearch/v1/overview.html They recently just changed this. The old google search API has now deprecated as of Nov 1st. Custom search is the new API.

Its pretty simple to use without Zend.

http://code.google.com/apis/customsearch/v1/using_rest.html#WorkingResults

There is a JSON decoder in PHP. http://php.net/manual/en/function.json-decode.php

Hope that helps!

The google search URL is pretty simple, I documented it here for a different reason. When you google something, for example 'blog' the page you are sent to is http://www.google.co.uk/search?q=blog. That bit after the ? is called the query string (in this case q=blog) which contains my search. Modifying this will modifiy googles search string, and return the appropriate results.

As for PHP you just need to add to the end of http://www.google.co.uk/search?q=

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!