提取外部URL文本 [英] Extract text from external URL

查看:118
本文介绍了提取外部URL文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我作出的份额,如Facebook链接功能。目前,我解析meta标签获得关键字,描述等,但如何分析这些类型的网页的http:// EN .wikipedia.org /维基/维基百科中没有此页没有meta描述但Facebook仍然获取了如下描述:
维基百科(/ˌwɪkɪpiːdi.ə/或/ˌwɪkipiːdi.ə/WIK-I-PEE-作dee-ə)是一个免费的,[3]基于Web的协作,多语言百科全书由非营利维基媒体基金会支持项目。 17个万篇文章(超过340万英文)已经由志愿者协同书面围绕

我怎么能提取如果在页面上没有发现meta描述标签这样的描述。


解决方案

看起来像它们所产生的描述相同的方式<一个href=\"http://www.bing.com/search?q=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWikipedia&go=&form=QBLH&qs=n&sk=\"相对=nofollow>兵做这可能是难以轻易重新创建:


  

如何产生冰的描述
  我的网站?


  
  

这就是你设计你的网页
  内容具有影响最大
  您的Web页面描述。由于MSNBot会
  抓取你的网站,它分析
  对索引的网页内容和
  产生的关键字与关联
  每个网页。 MSNBot会提取网页
  网页内容最相关
  的关键字,并构造在Web
  出现在现场的描述
  搜索结果。网页内容
  通常是句子的细分
  包含关键字或信息
  description标签。网页
  标题和URL也被提取并
  出现在搜索结果中。


  
  

如果您更改Web内容
  网页,你的网页的描述可能
  改变下一次冰指数
  更新。要影响你的网站
  说明,请确保您的Web
  页面有效地传递
  信息要在搜索
  结果。网管中心建议
  以下策略时,
  设计内容:

附近的每个Web页面的顶部

  *放置描述性内容。
*确保每个网页都有一个明确的主题和目的。
*创建独特的&LT;标题&GT;标记内容的每一页。
*添加网站描述&LT;&荟萃GT;标签来描述的目的


  
  

您网站上的每一页。例如:


 &GT; &LT; META NAME =说明
&GT; CONTENT =示例文本 - 描述你的

http://www.bing.com/tool​​box/support/faqs.aspx

一个选择是打冰,并试图从那里提取的说明。

I am making share a link feature like facebook. Currently I am parsing meta tags to get keywords, descriptions e.t.c but how to parse these type of pages http://en.wikipedia.org/wiki/Wikipedia There is no meta description for this page but facebook still fetches the following description: Wikipedia ( /ˌwɪkɪˈpiːdi.ə/ or /ˌwɪkiˈpiːdi.ə/ WIK-i-PEE-dee-ə) is a free,[3]web-based, collaborative, multilingual encyclopedia project supported by the non-profit Wikimedia Foundation. Its 17 million articles (over 3.4 million in English) have been written collaboratively by volunteers around the

How can I extract such description if there is no meta description tag found on the page.

解决方案

Looks like they generate the description the same way Bing does which might be difficult to easily re-create:

How does Bing generate a description of my Web site?

The way you design your Web page content has the greatest impact on your Web page description. As MSNBot crawls your Web site, it analyzes the content on indexed Web pages and generates keywords to associate with each Web page. MSNBot extracts Web page content that is most relevant to the keywords, and constructs the Web site description that appears in search results. The Web page content is typically sentence segments that contain keywords or information in the description tag. The Web page title and URL are also extracted and appear in the search results.

If you change the contents of a Web page, your Web page description might change the next time the Bing index is updated. To influence your Web site description, make sure that your Web pages effectively deliver the information you want in the search results. Webmaster Center recommends the following strategies when you design your content:

* Place descriptive content near the top of each Web page.
* Make sure that each Web page has a clear topic and purpose.
* Create unique <title> tag content for each page.
* Add a Web site description <meta> tag to describe the purpose of

each page on your site. For example:

> <META NAME="Description"
> CONTENT="Sample text - describe your

http://www.bing.com/toolbox/support/faqs.aspx

One option would be to hit Bing and try to fetch the description from there.

这篇关于提取外部URL文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆