【发布时间】:2011-09-15 16:20:59
【问题描述】:
我正在尝试使用 c# 为学校项目下载此网页的源代码。
这是我试图获取的页面:
http://www.epicurious.com/tools/fooddictionary/entry?id=1650
我试过这样的代码
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://www.epicurious.com/tools/fooddictionary/entry?id=1650");
并通过使用
WebClient client = new WebClient();
string value = client.DownloadString("http://www.epicurious.com/tools/fooddictionary/entry?id=1650");
这两种方法都没有让我获得页面源。任何帮助将不胜感激。
【问题讨论】:
-
当你说“来源”时,你的意思是 HTML,对吧?
标签: c# download webclient httprequest webpage