Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 获取网站中发布的内容(作业)列表_Asp.net Mvc_Url - Fatal编程技术网

Asp.net mvc 获取网站中发布的内容(作业)列表

Asp.net mvc 获取网站中发布的内容(作业)列表,asp.net-mvc,url,Asp.net Mvc,Url,我有一个asp.NETMVC应用程序,当我传递另一个网站的url时,我需要显示该网站的所有工作详细信息 我试过以下两种方法。但从来没有为我工作过 XmlReader reader = XmlReader.Create("https://careers.microsoft.com/recommendedjobs.aspx"); SyndicationFeed feed = SyndicationFeed.Load(reader); 因为我没有网站url()的xml格式,所以我

我有一个asp.NETMVC应用程序,当我传递另一个网站的url时,我需要显示该网站的所有工作详细信息

我试过以下两种方法。但从来没有为我工作过

     XmlReader reader = XmlReader.Create("https://careers.microsoft.com/recommendedjobs.aspx");
     SyndicationFeed feed = SyndicationFeed.Load(reader);
因为我没有网站url()的xml格式,所以我从这段代码中得到了错误。 然后我试着

     var client = new WebClient();
     var data = client.DownloadString("https://careers.microsoft.com/recommendedjobs.aspx");
但是在这里的数据中,我得到了网页的html内容(html数据包括 )


如何使用mvc.net获取网站中发布的作业列表

string url=“”;var client=new WebClient();var html=client.DownloadString(url);HtmlAgilityPack.HtmlDocument webhtml=新的HtmlAgilityPack.HtmlDocument();webhtml.LoadHtml(html);webhtml.DocumentNode.SelectSingleNode(//description”).InnerText;}var descriptionNode=webhtml.DocumentNode.SelectSingleNode(//meta[@property='og:description']|//meta[@name='description']]|//meta[@name='description']);var description=descriptionNode==null?null:descriptionNode.Attributes[“content”]。值;如果(description==null){description=webhtml.DocumentNode.SelectSingleNode(“//description”)==null?null:webhtml.DocumentNode.SelectSingleNode(“//description”).InnerText;}我已经使用了上述代码(作为两条注释给出)。但我只得到一部分数据作为描述,并没有得到完整的工作细节。请任何人都可以建议一种提供完整数据的替代方法?