现在有一个网页(大家放心此网站不会有毒di):
http://partsurfer.hp.com/Search.aspx?searchText=432320-001当打开此网页后,点击网页中部的黄色区域(标注有Click here的区域)将展开一个类似的列表,此列表中的内容正是我想获取的。但这些个列表内容,从网页的源代码中没有找到。问题来了,通过什么方法可以获取到!有劳各位大侠!!!

解决方案 »

  1.   

    列表是ajax取得的,从ajax的代码入手试试?
      

  2.   

    查看页面源代码,找到Ajax请求的网址以及参数,然后你把那个作为你抓取的目标页
      

  3.   

    找了半天,也没有找到。由于本要是菜鸟级的,对于WebForm等不了解,所以还请大侠帮忙,怎么在页面源代码里找到请求的网址和参数。谢谢!各位了!
      

  4.   

    不知道我这个办法能帮不帮上你的忙。
    : string phoneNum = tbPhoneNum.Text;
                try
                {
                    //web客户端
                    WebClient webclient = new WebClient();
                    //下载数据
                    string str_ = webclient.DownloadString("http://www.ip138.com:8080/search.asp?mobile=" + phoneNum + "&action=mobile");
                    //正则
                    string str_regex = "><!-- <td></td> -->.*</TD>";
                    //忽略大小写
                    Regex regex = new Regex(str_regex, RegexOptions.IgnoreCase);
                    //开始匹配
                    MatchCollection matchCollection = regex.Matches(str_);                txtAddress.Text = "卡归属地:" + matchCollection[0].Value.Replace("><!-- <td></td> -->","").Replace("</TD>","").Replace("&nbsp;",",");                txtType.Text = "卡类型:" + matchCollection[1].Value.Replace("><!-- <td></td> -->", "").Replace("</TD>", "");
                }
                catch (Exception ex) { }
    上面的是使用拿下网页信息,然后用正则过滤出自己要的内容。