我需要从imdb非官方的api "omdbapi".I发送正确的链接信息,但是当我得到响应时,文档是空的,我在使用htmlagiltypack.what,我做错了吗?
以下是直接链接:http://www.omdbapi.com/?i=tt2231253&plot=short&r=xml
string url = "http://www.omdbapi.com/?i=" + ImdbID + "&plot=short&r=xml";
HtmlWeb source = new HtmlWeb();
HtmlDocument document = source.Load(url);发布于 2015-02-03 12:21:55
它不是Html,而是您期望的XML文档。试一试:
string url = "http://www.omdbapi.com/?i=tt2231253&plot=short&r=xml";
WebClient wc = new WebClient();
XDocument doc = XDocument.Parse(wc.DownloadString(url));
Console.WriteLine(doc);https://stackoverflow.com/questions/28298612
复制相似问题