如题,winform中
http://xue.youdao.com/card#735
请问如何能取到类似于firebug看到的代码一样找到链接里面的数据
WebRequest request = WebRequest.Create("http://xue.youdao.com/card#735");
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("utf-8"));
textBox1.Text = reader.ReadToEnd();
这里取到的字符串中是 <img src=""></div>
而在firebug中看到的是我想要的
src="http://oimagec1.ydstatic.com/image?product=dict-treasury&id=-9116571441237321213&w=400&h=340"
新手,js一点不会
http://xue.youdao.com/card#735
请问如何能取到类似于firebug看到的代码一样找到链接里面的数据
WebRequest request = WebRequest.Create("http://xue.youdao.com/card#735");
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("utf-8"));
textBox1.Text = reader.ReadToEnd();
这里取到的字符串中是 <img src=""></div>
而在firebug中看到的是我想要的
src="http://oimagec1.ydstatic.com/image?product=dict-treasury&id=-9116571441237321213&w=400&h=340"
新手,js一点不会
你获取到的只是输出的html大概步骤:直接获取ajax请求地址(如果只是个案的话,当然 一般不可能)》》》获取网页》正则 找到ajax请求地址》获取请求地址网页》正则 找到实际数据
下面是json的第一子节点数据"1":{"imgId":"6554285643492469812","examplesEn":"What usually happens is that people wait until they are really \nfed up, and then they blow their stack.","trans":"感到厌烦的;忍无可忍\n","des":"{id:504,create_time:\"2013-04-01 15:19:32\",re:\"\",share:\"\",phonogram:\"[fed][ʌp]\",Examples_en:\"What usually happens is that people wait until they are really <br \/>fed up, and then they blow their stack.\",Examples_zh:\"通常人们会等到实在无法忍受才会爆发。\",annotation:\"感到厌烦的;忍无可忍<br \/>\",ori_img_id:8571294699692216353}","examplesZh":"通常人们会等到实在无法忍受才会爆发。","oriImgId":"8571294699692216353","pron":"[fed][ʌp]","word":"fed up","date":"2013-04-03"}这些就是网页上那些数据,你都解析下就行了。 其中的ori_img_id或oriImgId就是那张图片,http://oimagec1.ydstatic.com/image?product=dict-treasury&id=8571294699692216353&w=400&h=340 直接访问就可以得到