public void Hap()
{
HtmlWeb.LoadAsync("http://www.mycollege.edu/news", OnCallback);
}
private void OnCallback(object s, HtmlDocumentLoadCompleted htmlDocumentLoadCompleted)
{
var htmlDocument = htmlDocumentLoadCompleted.Document;
//use agilitypack to parse out news
}
另一种方法是让某种服务实际执行新闻数据的抓取和管理,然后您控制移动设备使用的格式,例如 XML 或 JSON。
If Windows 7, there is a version of the HtmlAgility Pack for WP7.
Here is a bit of sample code:
public void Hap()
{
HtmlWeb.LoadAsync("http://www.mycollege.edu/news", OnCallback);
}
private void OnCallback(object s, HtmlDocumentLoadCompleted htmlDocumentLoadCompleted)
{
var htmlDocument = htmlDocumentLoadCompleted.Document;
//use agilitypack to parse out news
}
Another approach is to have a service of some sort actually do the scraping and management of the news data then you control the format that the mobile devices consume like XML or JSON.
发布评论
评论(2)
如果是 Windows 7,则有一个适用于 WP7 的 HtmlAgility Pack 版本。
下面是一些示例代码:
另一种方法是让某种服务实际执行新闻数据的抓取和管理,然后您控制移动设备使用的格式,例如 XML 或 JSON。
If Windows 7, there is a version of the HtmlAgility Pack for WP7.
Here is a bit of sample code:
Another approach is to have a service of some sort actually do the scraping and management of the news data then you control the format that the mobile devices consume like XML or JSON.
查看此问题以获取有关 html 解析的一些线索。 在 Android 中解析 HTML
剧透是一个包含一些 java html 解析内容的链接,您可以尝试:
http://java-source.net/open-source/html-parsers
根据您尝试解析的 html,您可能会更幸运或更坏地从中获得您想要的内容。
Check out this question for some clues on html parsing. Parse HTML in Android
spoiler here is a link that has some java html parsing things that you can try:
http://java-source.net/open-source/html-parsers
Depending on the html that you are trying to parse you may have better or worse luck actually getting the content you want to out of it.