什么是包装器以及如何在我的应用程序中使用? [英] what is wrapper and how can uses in my application?

查看:60
本文介绍了什么是包装器以及如何在我的应用程序中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是包装?

我想在C#程序中使用解析器。但这是Java解析器。但是有一个C#包装器。如何将其添加到程序中。

最好使用解析器?

链接解析器: http://htmlunit.sourceforge.net/

解决方案

请参阅我对该问题的评论。我怀疑你可以简单地使用你所引用的内容......你需要使用别的东西。



如果你想解析格式良好的HTML作为XML(并且只有这样的HTML有权存在,但在现实生活中... :-(),这是最好的情况,因为.NET FCL有三种不同的XML解析器(至少;如果你愿意,我可以参考/概述它们,但你会很容易找到它们。如果不是这种情况,你将需要一些HTML解析器来做脏工作。试试这个:

http://www.majestic12.co.uk/projects/html_parser.php [ ^ ]。







这是 Web抓取的问题: http://en.wikipedia .org / wiki / Web_scraping [ ^ ]。



请同时查看我过去的答案:

http ://en.wikipedia.org/wiki/Web_scraping [ ^ ],

获取具体数据来自网页 [ ^ ],

如何从其他网站获取数据 [ ^ ]。



-SA


evr写道:

解析器之间有什么爬虫? (差异)

所有差异问题本质上都是错误的。如果某些内容非常相似,它只能用作语言。如果有些事情与另一件事无关,你将无法定义差异的概念。如果可以的话,你可以回答苹果和苹果之间有什么区别,但是你能做到吗? :-)



情况确实如此。所以,只要了解它们是什么:



http:// en。 wikipedia.org/wiki/Parser [ ^ ],

http://en.wikipedia.org/wiki/WebCrawler [ ^ ]。



我想,爬虫必须使用一些解析器作为其实现细节。不过我喜欢。



足够清楚了,不是吗?



-SA

What''s Wrapper?
I want to use the parser in a C # program. But this is Java parser. But there is a Wrapper for C #. How can I add it to the program.
It is best to use a parser?
link parser: http://htmlunit.sourceforge.net/

解决方案

Please see my comment to the question. I doubt you can simply use what you have referenced… You need to use something else.

If you want to parse HTML which is well-formed as XML (and only such HTMLs have a right to exist, but in real life… :-(), this is the best case, as .NET FCL has three different XML parsers (at least; I can reference/overview them if you want, but you will easily find them). If this is no case, you will need some HTML parser to do the dirty job. Try this one:
http://www.majestic12.co.uk/projects/html_parser.php[^].

[EDIT]

This is a problem of Web scraping: http://en.wikipedia.org/wiki/Web_scraping[^].

Please also see my past answers:
http://en.wikipedia.org/wiki/Web_scraping[^],
get specific data from web page[^],
How to get the data from another site[^].

—SA


e.v.r. wrote:

What are crawler between the parser? (Difference)

All "difference" questions are inherently incorrect. It only can be used as a figure of speech, if something is very similar. If some things have nothing to do one with another, you won''t be able to define the notion of "difference". If you could, you would be able to answer "what''s the difference between apple and Apple", but can you? :-)

And this is exactly the case. So, just learn what are they:

http://en.wikipedia.org/wiki/Parser[^],
http://en.wikipedia.org/wiki/WebCrawler[^].

The crawler has to use some parser, as its implementation detail, I guess. I depends though.

Clear enough, isn''t it?

—SA


这篇关于什么是包装器以及如何在我的应用程序中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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