Google自定义搜索引擎-在SERP中编辑URL

问题描述 投票:0回答:1

[晚上好,我正在使用Google自定义搜索引擎:https://cse.google.it/cse/,我只需要为某些URL(总共10个URL)在每个搜索结果URL的末尾添加一个参数。例如:如果域为www.dominio-test.com,则显示的URL为www.dominio-test.com/123456,CSE会在网络上进行无限制搜索。

我使用的代码如下:

    <script async src = "https://cse.google.com/cse.js cx=014431187084467459449:v2cmjgvgjr0"> </script>

    <div class = "gcse-search"> </div>

我曾考虑过使用getElementsByClassName()读取DOM,提取内容并将其添加到变量中,这时添加if / else / replace控件并再次输出。

但是我不知道该如何进行,您能支持我吗?谢谢,干得好

google-custom-search
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.