大致是输入检索条件,点查询按钮,然后查询一下google,
然后把查出的数据信息插到数据库中。

解决方案 »

  1.   

    这个在CSDN上记得有人问过的,这个不知道是哪位的回答了,借用下:
    服务器端: 
    <%response.contenttype   =   "text/xml "%> 
    <%response.charset   =   "GB2312 "%> 
    <!--#include   file= "../include/function.asp "--> 
    <% 
    'on   error   resume   next 
    Function   send_request(s) 
      Set   Retrieval   =   CreateObject( "Microsoft.XMLHTTP ") 
      dim   url 
      url   =   "http://www.google.cn/search?q= "   &   s   &   _ 
         "&ie=gb2312&hl=zh-CN&lr=lang_zh-cn&oe=utf-8&sa=N " 
      With   Retrieval 
        .Open   "Get ",   url,   False,   " ",   " " 
        .setRequestHeader   "Content-Length ",   len(url) 
        .setRequestHeader   "Content-Type ",   "application/x-www-form-urlencoded " 
        .Send 
        if   err.number   <>   0   then 
          send_request   =   err.description 
        else 
          send_request   =   replace(.responsetext, " " " ", "&quot; ") 
        end   if 
      End   With 
      Set   Retrieval   =   Nothing 
    End   Function dim   keyword 
    keyword=Request( "q ") 
    response.write   " <?xml   version= " "1.0 " "   encoding= " "GB2312 " "?> "   &   chr(13) 
    response.write   " <root> "   &   chr(13) 
    response.write   " <query> <![CDATA[ "   &   send_request(keyword)   &   "]]> </query> "   &   chr(13)
    response.write   " </root> " 
    %> 
    以上存为QueryWeb.asp 客户端 
    listBody2.innerHTML   =   " <img   src=\ "images/loading.gif\ "> 数据正在查询,请稍候... "; 
    var   keyword   =   keywords.innerText.split( "  "); 
    var   q   =   " "; 
    for(i=0;   i <keyword.length;   i++){ 
      q   +=   i   !=   keyword.length   -1   ?   keyword[i]+ "+ "   :   keyword[i]; 

    url   =   "app/QueryWeb.asp?q= "+q; 
    XMLHttp.sendReq( "GET ",   url,   ' ',   doWriteList22); function   doWriteList22(http){ 
      if(http.readyState   ==   4){ 
        var   xml   =   http.responseXML; 
        var   res   =   xml.selectSingleNode( "root/query ").childNodes[0].nodeValue; 
        res   =   res.replace(/\ "/ig,   ' '); 
        var   resArr   =   res.match(/ <h2   class=r> ((?! <\/h2> ).)* <\/h2> /ig); 
        var   HTML   =   " <table   width=100%   cellpadding=5   cellspacing=0   border=0> "; 
        var   href   =   " ",   link   =   " ",   link2   =   " "; 
        for(i=0;i <10;i++){ 
          if(i   ==   resArr.length)   break; 
          href   =   resArr[i].match(/href=(.[^   ]*)   /ig); 
          link   =   resArr[i].match(/ <a.*\/a> /ig); 
          link2   =   link[0].replace(/ <(.[^> ]*)> /ig, " "); 
          HTML   +=   " <tr> <td   width=80%   valign=center   height=20px> <img   src=images/listHeader.gif>   "+ 
           " <a   "+href[0].replace(/&quot;/ig,   " ")+ "   target=_blank   title=\ " "+link2+ "\ "   class=tabList> "+link2.truncate(25)+ " </a> </td> </tr> "; 
        } 
        HTML   +=   " </table> " 
        listBody2.innerHTML   =   HTML; 
      } 
    } 用以上方式实现的页面,页面中点击左侧站外链接后就是通过GOOGLE搜索“关键字”后取得的内容 
    http://www.speedsoftech.com/readnews.htm?newsid=49
      

  2.   

    你可以用google的开放api,或者用zend framework,它直接封闭了google的api
      

  3.   

    google api  看下官方文档
      

  4.   

    <?php
    header("Content-Type: text/html;charset=utf-8");
    $content="中国人民银行";
    $url = "http://www.google.com.hk/search?hl=zh-CN&source=hp&q={$content}&btnG=Google+%E6%90%9C%E7%B4%A2&meta=lr%3Dlang_zh-CN&aq=f&aqi=&aql=&oq=&gs_rfai=";$cookie_file = "google.txt";$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
    $contents = curl_exec($ch);
    curl_close($ch);
    echo $contents ;
    ?>[/code]