修复百度站内搜索不能搜索问题

百度站内搜索不能使用

最近发现百度站内搜索无法使用,搜索后提示页面不存在。
在这里插入图片描述
通过查询发现可以使用以前的搜索代码:

<form target="_blank" action="http://zhannei.baidu.com/cse/site">
<input type="text" name="q" />
<input type="submit" value="站内搜索">
<input name="ie" type="hidden" value="utf-8" />
<input name="cc" type="hidden" value="taiwan.cn" />
</form>

在这里插入图片描述

其他站内搜索引擎:
站内搜索代码:

1、google搜索:

<form method=get action="http://www.google.com/search">
<input type=text name=q>
<input type=submit name=btnG value="Google 搜索">
<input type=hidden name=ie value=GB2312>
<input type=hidden name=oe value=GB2312>
<input type=hidden name=hl value=zh-CN>
<input type=hidden name=domains value="taiwan">
<input type=hidden name=sitesearch value="taiwan">
</form>

2、雅虎搜索;

<form action="http://www.yahoo.com.cn/search">
<input type=text name="p">
<input type="submit" value="Yahoo 搜索">
<input type=hidden name=vs value="taiwan">
</form>

3、360搜索;

<form target="_blank" action="https://www.so.com/s">
<input type="text" name="q" />
<input type="submit" value="360 搜索">
<input type="hidden" name="ie" value="utf-8">
<input type="hidden" name="src" value="https://www.taiwan.cn/">
<input type="hidden" name="site" value="https://www.taiwan.cn/">
<input type="hidden" name="rg" value="1">
<input type="hidden" name="inurl" value="">
</form>

4、搜狗搜索;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="/images/logo2014/new/favicon.ico" type="image/x-icon">
<title>高级搜索</title>
<link href="http://www.sogou.com/advanced/css/advanced.css?ver=1.2" rel="stylesheet" type="text/css">
<script type="text/javascript">
function getRadioValue(ele){
  	var filetypes=document.getElementsByName(ele);
	var filetype = null;
	for(var i=0;filetypes && i<filetypes.length; i++){
		if(filetypes[i].checked){
			filetype = filetypes[i].value;
		}
	}
	return filetype
	
}
function readQuery(){

	var query=document.searchForm.q.value,exclude="";
	//var exclude=document.searchForm.exclude.value;
	var sitequery=document.searchForm.sitequery.value;

	 var include = document.getElementById("include");
	 if (include.checked) {
	 	var querys = query.split(" ");
	 	query = "";
	 	for(var i=0; i<querys.length; i++){
	 		var tmp = querys[i];
	 		if(tmp == "")
	 			continue;
	 		query += "\""+tmp+"\""+" ";
		}
	}
	
	
    var sub="-";
    var inc="\"";
    var space=" ";
 
    
    
	if(exclude!=null&&exclude.length>0){
		query=query+space+sub+exclude;
	}
	if(sitequery!=null&&sitequery.length>0){
		if((query==null||query.length==0)){
			alert("指定网站内搜索的查询请输入'关键词'");
			return false;
		}
			query=query+space+"site:"+sitequery;
	}
	
	var filetype = getRadioValue('filetype');
	if(filetype!=null&&filetype.length>0){
		if((query==null||query.length==0)){
			alert("指定文件格式的查询请输入'关键词'");
			return false;
		}
		query=query+space+"filetype:"+filetype; 
	}
	

	var checkValue = getRadioValue("located");
	if (checkValue==0){
                document.searchForm.fieldtitle.value='';
                document.searchForm.fieldcontent.value='';
                document.searchForm.fieldstripurl.value=''; 
	}
	else if (checkValue==1){
		query = "intitle:"+query;
                document.searchForm.fieldtitle.value="on";
                document.searchForm.fieldcontent.value='';
                document.searchForm.fieldstripurl.value='';		
	}
	else if(checkValue==2){
//		query = "intext:"+query;
                document.searchForm.fieldcontent.value="on";
                document.searchForm.fieldtitle.value='';
                document.searchForm.fieldstripurl.value='';  
	}
	else if(checkValue==3){
		query = "inurl:"+query;
                document.searchForm.fieldstripurl.value="on";
                document.searchForm.fieldcontent.value='';
                document.searchForm.fieldtitle.value='';
	}

	document.searchForm.query.value=query;
	
	document.searchForm.bstype.value='';

	return true;
	
}
</script>
</head>
<body onload=m_s()>
<div class="logo"><img src="/images/logo2014/gaojisousuo.png?v=2" alt="搜狗高级搜索" width="202" height="53"></div>
<form action="http://www.sogou.com/web" target="_blank" name="searchForm" id="searchForm" onsubmit="return readQuery();">
  <div class="advanced">
    <div id="n"><a href="http://news.sogou.com" onclick="s(this)">&nbsp;</a><strong>&nbsp;</strong><a href="http://mp3.sogou.com" onclick="s(this)">&nbsp;</a><a href="http://pic.sogou.com" onclick="s(this)">&nbsp;</a><a href="http://v.sogou.com" onclick="s(this)">&nbsp;</a><a href="http://map.sogou.com" onclick="s(this)">&nbsp;</a><a href="http://zhishi.sogou.com/" onclick="s(this)">&nbsp;</a><a href="javascript:void(0)" onclick="return moreddshow(event);" id="vm">&nbsp;</a>
      <div id="vl"><a href="http://blogsearch.sogou.com/" onclick="s(this)">博客</a><a href="http://www.sogou.com/labs/">实验室</a><a href="http://123.sogou.com/">网址导航</a><a href="http://www.sogou.com/docs/more.htm?v=1" class="ap">所有产品</a></div>
    </div>
    <input name="q" class="q" onfocus="this.select()" size="42" maxlength="100">
    <input name="query" type="hidden" value="">
<input name="fieldtitle" type="hidden" value=""/>
<input name="fieldcontent" type="hidden" value=""/>
<input name="fieldstripurl" type="hidden" value=""/>
<input name="bstype" type="hidden" value=""/>
<input name="ie" type="hidden" value="utf8"/>
  </div>
  <div class="opt">
    <label>
    <input type="checkbox" name="include" id="include" value="checkbox">
    不拆分关键词</label>
    <table>
    	<!--tr>
        <th>去除</th>
        <td><input name="exclude" type="text" size="40"></td>
      </tr-->
      <tr>
        <th>在指定站内搜索</th>
        <td><input name="sitequery" type="text" size="40"></td>
      </tr>
      <tr>
        <th>搜索词位于</th>
        <td><label><input name="located" type="radio" value="0" checked>网页的任何地方</label>
          <label><input type="radio" name="located" value="1">仅在标题中</label>
          <label><input type="radio" name="located" value="2">仅在正文中</label>
          <label><input type="radio" name="located" value="3">仅在网址中</label></td>
      </tr>
      <tr>
        <th>搜索结果排序方式</th>
        <td><label><input name="tro" type="radio" value="off" checked>按相关性排序&nbsp;&nbsp;</label>
          <label><input type="radio" name="tro" value="on">按时间排序</label></td>
      </tr>
      <tr>
        <th>指定文件格式</th>
        <td><label><input type="radio" name="filetype" value="doc">word(.doc)</label>&nbsp;
          <label><input type="radio" name="filetype" value="pdf">PDF(.pdf)</label>
          <label><input type="radio" name="filetype" value="ppt">PPT(.ppt)</label><br/>
          <label><input type="radio" name="filetype" value="xls">excel(.xls)</label>
          <label><input type="radio" name="filetype" value="rtf">RTF(.rtf)</label>
          <label><input type="radio" name="filetype" value="all">全部文档</label>
          <label><input type="radio" name="filetype" checked value="">全部网页</label>
        </td>
      </tr>
      <tr>
        <th>每页显示</th>
        <td><select name="num">
            <option value="10" selected="selected">10条结果</option>
            <option value="20" >20条结果</option>
            <option value="30" >30条结果</option>
            <option value="50" >50条结果</option>
            <option value="100" >100条结果</option>

          </select>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" value="搜狗搜索"></td>
      </tr>
    </table>
  </div>
  <div class="exlink"><a href="/">返回首页</a><a href="/advanced/config.html">个性设置</a></div>
</form>
<div id="ft">
  &copy; <script type="text/javascript" src="/websearch/features/year.jsp"></script> SOGOU.COM <a href="http://www.miibeian.gov.cn" class="g">ICP050897</a> <a href="http://www.sogou.com/docs/terms.htm?v=1" class="g">免责声明</a> <span class="ba">&nbsp;</span></div>
<script type="text/javascript">
function m_s(){var w=document.searchForm.q;w.focus();if(new RegExp("kw=([^&]+)").test(location.search)){if(w.value.length==0)w.value=decodeURIComponent(RegExp.$1)}}function s(o){var w=document.searchForm.q;if(w.value.length>0){var h=o.href;var q=encodeURIComponent(w.value);if(h.indexOf("kw=")>0){o.href=h.replace(new RegExp("kw=[^&$]*"),"kw="+q)}else{o.href+="?&kw="+q}}};function moreddshow(C){var B=document.getElementById("vl");var A=document.getElementById("vm");if(!B||!A){return false}if(B.style.display!="block"){B.style.display="block";A.className="on"}else{B.style.display="none";A.className=""}return false}document.onclick=function(F){F=F?F:(window.event?window.event:null);var E=(F.target)?F.target:F.srcElement;var A=E.id;var D=document.searchForm.query.value;if(D!=""){while(E.tagName&&E.tagName.toUpperCase()!="A"&&E!=E.parentNode){E=E.parentNode}if(E.tagName&&(E.tagName.toUpperCase()=="A")&&E.id.indexOf("sogou")==0){E.href+="?kw="+escape(D)}}var C=document.getElementById("vl");var B=document.getElementById("vm");if(A!="vm"&&C&&B&&A!="vsearchmorear"){C.style.display="none";B.className=""}};</script>
</body>
</html>
<!--zly-->

下面是Google和百度的Javascript版的站内搜索代码:

Google站内搜索

<script type="text/javascript">
function googlesearch () {
var wq=document.getElementsByName("wq")[0].value;
var link="http://www.google.com/search?domains=www.williamlong.info&sitesearch=xinyucn&q="+wq;
window.open(link); }
</script>
<input type="text" name="wq"/><input type="submit" onclick="javascript:googlesearch()" value="Google 搜索" />

Baidu站内搜索

<script language="javascript"> function baidusearch () {
var wd=document.getElementsByName("wd")[0].value;
var link="http://www.baidu.com/s?si=xinyucn&cl=3&ct=2097152&tn=baidulocal&word="+wd;
window.open(link); }
</script>
<input type="text" name="wd"/><input type="submit" onclick="javascript:baidusearch()" value="Baidu 搜索" />

https://www.xinyucn.cc/2022/07/google_bai_du_ya_hu_he_360.html#

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值