首页 新闻 会员 周边 捐助

WebRequest请求一个jsp页面的响应结果包含<% %>等代码,如何获取编译后的文件?

0
悬赏园豆:30 [已关闭问题] 关闭于 2021-04-20 16:25

public IActionResult Index()
{
var _result = GetHTMLByURL("https://buff.163.com/market/goods?goods_id=835707&from=market#tab=selling");
return View();
}
public static string GetHTMLByURL(string url)
{
try
{
System.Net.WebRequest wRequest = System.Net.WebRequest.Create(url);
wRequest.ContentType = "text/html; charset=utf-8";
wRequest.Method = "get";
wRequest.UseDefaultCredentials = true;
var task = wRequest.GetResponseAsync();
System.Net.WebResponse wResp = task.Result;
System.IO.Stream respStream = wResp.GetResponseStream();
using (System.IO.StreamReader reader = new System.IO.StreamReader(respStream, Encoding.GetEncoding("utf-8")))
{
return reader.ReadToEnd();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
return string.Empty;
}
}

Mr丶Yan的主页 Mr丶Yan | 初学一级 | 园豆:64
提问于:2021-04-20 09:45
< >
分享
所有回答(1)
0

使用 Selenium.WebDriver 操作获取内容

Mr丶Yan | 园豆:64 (初学一级) | 2021-04-20 16:25
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册