自定义搜索引擎_如何创建自己的自定义Google搜索引擎

自定义搜索引擎

自定义搜索引擎

image

Have you ever wanted to create a custom Google search engine that searches only specific websites? You can easily do this with Google’s Custom Search Engine tool. You can bookmark your search engine and even share it with other people.

您是否曾经想过创建仅搜索特定网站的自定义Google搜索引擎? 您可以使用Google的“自定义搜索引擎”工具轻松完成此操作。 您可以为搜索引擎添加书签,甚至可以与他人共享。

This trick works similarly to Google’s site: operator, but you won’t have to type the operator every time you search. It’s particularly useful if you want to search a large number of sites at once.

此技巧的用法类似于Google的站点:operator ,但是您不必在每次搜索时都键入运算符。 如果要一次搜索大量站点,此功能特别有用。

创建自定义搜索引擎 (Creating a Custom Search Engine)

To get started, head over to the Google Custom Search Engine page and click the Create a custom search engine button. You’ll need a Google account for this – the search engine will be saved with your Google account.

首先,请转到Google自定义搜索引擎页面,然后单击创建自定义搜索引擎按钮。 为此,您需要一个Google帐户-搜索引擎将与您的Google帐户一起保存。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>自定义搜索引擎</title> <style> body { background-color: #f2f2f2; font-family: Arial, sans-serif; } .container { margin: 50px auto; width: 500px; } .search-form { background-color: #fff; border-radius: 5px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); padding: 10px; position: relative; } .search-form input[type="text"] { border: none; border-radius: 5px; font-size: 16px; padding: 5px 10px; width: 80%; } .search-form button { background-color: #1abc9c; border: none; border-radius: 5px; color: #fff; cursor: pointer; font-size: 16px; padding: 5px 10px; position: absolute; right: 0; top: 0; } </style> </head> <body> <div class="container"> <div class="search-form"> <input type="text" id="searchBox" placeholder="在这里输入要搜索的内容"> <button onclick="search()">搜索</button> </div> </div> <script> function search() { var searchBox = document.getElementById("searchBox"); var searchEngine = document.querySelector('input[name="searchEngine"]:checked').value; var query = encodeURIComponent(searchBox.value); var url; switch(searchEngine) { case "google": url = "https://www.google.com/search?q=" + query; break; case "baidu": url = "https://www.baidu.com/s?wd=" + query; break; case "bing": url = "https://www.bing.com/search?q=" + query; break; default: url = "https://www.google.com/search?q=" + query; } window.location.href = url; } </script> <div class="container"> <form> <input type="radio" id="google" name="searchEngine" value="google" checked> <label for="google">Google</label> <input type="radio" id="baidu" name="searchEngine" value="baidu"> <label for="baidu">Baidu</label> <input type="radio" id="bing" name="searchEngine" value="bing"> <label for="bing">Bing</label> </form> </div> </body> </html>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值