如何通过仅将URL作为输入来生成URL的URL预览 [英] How to generate URL preview of an URL, by giving the URL only as input

查看:168
本文介绍了如何通过仅将URL作为输入来生成URL的URL预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过使用angularjs将URL仅作为输入来生成URL的URL预览





我尝试了什么:



不知道怎么开始。任何人都可以提出任何想法或样本。

解决方案

为此您需要实际下载该URL的内容,然后将它们解析为运行时对象,通过XML序列化或任何其他过程。然后你会读取诸如< title> < meta description> 等元素,然后你才会将会这样做。



但是,你可以使用一个非常干净的工具,你可以使用的HtmlAgilityPack,作为一个C#库来加载内容和然后捕获文档的内容(例如上面提到的内容),然后在文档中显示它们。



获取元素HtmlAgilityPack | ASP.NET论坛 [ ^ ]



您还可以从他们的一个文档中了解更多关于库的信息,它在技术上是一个序列化程序和一个HTTP客户端,可以下载内容,然后让您阅读运行时的文档。 : - )

How to generate URL preview of an URL, by giving the URL only as input using angularjs



What I have tried:

no idea how to start. Can anybody give any idea or sample to go ahead.

解决方案

For that you would need to actually download the contents of that URL and then parse them to a runtime object, either by XML serialization or from any other procedure. Then you would be reading elements such as, <title> or <meta description> etc, only then you will be to do that.

However, there is a very clean tool that you can use, HtmlAgilityPack that you can use, as a C# library to load the content and then capture the contents of the document (such as the ones mentioned above), after that show them in the document.

Getting Element HtmlAgilityPack | The ASP.NET Forums[^]

You can also learn more on the library from one of their documentations, it is technically a serializer and an HTTP client that downloads the content and then lets you read the document on runtime. :-)


这篇关于如何通过仅将URL作为输入来生成URL的URL预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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