请大家点击 http://www.chineselovelinks.com/chinese/results/searchresults.cfm?searchtype=1&sortby=12&searchview=3&cache=1
打开后把鼠标放到一个人的姓名的位置,在看状态栏 有个链接
我想在后台获得这个链接串 怎么获得

解决方案 »

  1.   

      同意。本来就有可以用JS去检索<a></a>里的链接
    var obj=document.getElementsByTagName("a");
        for(var i = 0;i<obj.length;i++) 
        {
            var ahref=obj[i]; //获取推荐链接
            document.writeln(ahref.innerText+" "+ahref["href"]+"<br>");
        }
      

  2.   

    在前台通过window.status这个属性可以获得你要的链接。
      

  3.   


    我就是要获得这个也的http://www.chineselovelinks.com/chinese/results/searchresults.cfm?searchtype=1&sortby=12&searchview=3&cache=1
    不是获得本地的 
      

  4.   

    通过webrequest获取页面代码,再通过正则获取href链接
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create("地址");
            req.Credentials = new NetworkCredential("用户名", "密码", "域名");
            req.Method = "GET";        
            IAsyncResult ir = req.BeginGetResponse(null, null);
            ir.AsyncWaitHandle.WaitOne();
            try {
                HttpWebResponse response1 = (HttpWebResponse)req.EndGetResponse(ir);
                System.IO.Stream stream = response1.GetResponseStream();
                sReader = new System.IO.StreamReader(stream, System.Text.Encoding.GetEncoding("GB2312"));
                if (null != sReader) {
                string pattern = @"<a(?:\s*?)href=['|""](?<url>[\s\S]+?)['|""]>(?<title>[\s\S]+?)</a>";
                System.Text.RegularExpressions.MatchCollection matchs = System.Text.RegularExpressions.Regex.Matches(sReader.ReadToEnd(), pattern);
                if (matchs.Count <= 0)
                    Response.Write("没有匹配项");
                else
                {
                 Response.Write("链接:" + matchs[i].Groups["url"].Value+"<br />");
                 }
                }
                }
            }
            catch (System.Exception ex) {
                Response.Write(ex.Message);
            }
            finally {
                if (null != sReader) {
                    sReader.Dispose();
                }
            }
     
    System.Net.HttpWebRequest quest=(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(URL);
    System.Net.HttpWebResponse sponse =(System.Net.HttpWebResponse)quest.GetResponse();
    StreamReader reader=new StreamReader(sponse.GetResponseStream(),Encoding.GetEncoding("GB2312"));
    string str;
    str=reader.ReadToEnd();string strPattern=@"a[\s]+href=(? <Link>[^\s>]+)[^>]*>(? <Text>[^ <]*) </a>"; 
                MatchCollection Matches=Regex.Matches(str,strPattern,RegexOptions.IgnoreCase|RegexOptions.Compiled); 
                foreach(Match NextMatch in Matches) 
                { 
                    string URL=NextMatch.Groups["Link"].Value.ToString().Trim(); 
                    string URLText=NextMatch.Groups["Text"].Value.ToString().Trim(); 
                    Response.Write(URL); 
                    Response.Write(URLText); 
                }