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.