如何检索标题和网页摘要按计划?摘要、标题、网页

由网友(往日情怀酿做酒)分享简介:像什么Digg的那样,当你提交一则新闻,标题和摘要的自动检索,该怎么办呢?Like what digg does,when you submit a news,the title and summary is automatically retrieved,how to do it?推荐答案检索HTML并解析它。...

像什么Digg的那样,当你提交一则新闻,标题和摘要的自动检索,该怎么办呢?

Like what digg does,when you submit a news,the title and summary is automatically retrieved,how to do it?

推荐答案

检索HTML并解析它。

Retrieve the HTML and parse it.

标题来自于<冠军> 标记。 摘要可以来自:

The title comes from the <title> tag. The summary can come from either:

从内部的第一对夫妇的可见文本的一百个字符的&LT;身体GT; 标记 的说明&LT;元&GT; 标记 The first couple of hundred characters of visible text from inside the <body> tag. The description <meta> tag.

如果网站提供的RSS源(你会发现在&LT;链接相对=交替式=申请/ RSS + XML&GT; 从替代标签)使用的列装的信息。

If the site provides an RSS feed (which you'll find in the <link rel="alternate" type="application/rss+xml"> tag) use the fielded information from that instead.

有没有一个正确的回答了这个问题。可能有其他可能的策略。但是,这应该让你开始。

There is no one right answer to this question. There are probably other strategies possible. But this should get you started.

阅读全文

相关推荐

最新文章