Is there a way to find google search results for a certain keyword with javascript? [closed]

爷,独闯天下 提交于 2020-01-24 12:25:04

问题


I am looking for a way to find search results from google with javascript.


回答1:


Yes, you can use Google's api to fetch search result from Google.

But for that you have to get a API key from Google and then you can use google's api to fetch result.

Please check this official link to know example and more.

Here is an example http get request

https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures

you can simply request these http get request from your javascript using ajax. In the above example you can replace the word lectures with the key word that you want to search.

You can find complete reference of using Javascript to request google's api here.



来源:https://stackoverflow.com/questions/42896175/is-there-a-way-to-find-google-search-results-for-a-certain-keyword-with-javascri

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