摘要
随着网络在世界范围的飞速发展,互联网作为最具潜力与活力的媒体已经被公认是继报纸,广播,电视之后的"第四媒体",成为反映社会新闻热点的重要载体。为了及时了解网络新闻热点,相关机构引入了新闻热点分析系统。本文设计的新闻爬虫系统是新闻热点分析系统的数据源,负责新闻信息的采集。
本文借助于爬虫领域的相关技术与工具,结合新闻热点分析系统的需求从原理或工作流程上详细论述了爬虫系统中核心模块的具体实现。
本文所描述的新闻爬虫系统其数据来源主要是新浪新闻,首先利用爬虫工具将新闻数据获取到本地数据库中,然后将新闻信息以及新闻分析的结果将在前台网页中进行可视化输出。本文主要进行了以下几个方面的工作:
1)利用Java语言结合HTTPClient开源工具编写了一个针对新浪新闻的可扩展的网络爬虫,该爬虫程序能够按照广度优先的爬行策略对新闻数据(包括图片信息)进行全面的定向抓取以及周期性的增量抓取;
2)采用HTMLParser对获取到的新闻信息进行元数据抽取,将新闻的编号、标题、内容、发布方、发布时间等元数据以及新闻图片等元数据解析出来并存入SQL Server数据库中;
3)前端界面利用开源AJAX框架ExtJS结合Servlet进行实现,兼顾用户交互方式的多样性以及系统的跨浏览器兼容性。
通过使用该新闻爬取系统,用户能够实时的更新新闻信息,及时、全面、准确地掌握新闻热点动态,提高对于重大突发事件的处理能力,对于更及时,全面的了解各地的实时信息具有重要意义。
关键词:新闻热点,网络爬虫,元数据抽取,可视化
ABSTRACT
With the rapid development of World Wide Web(WWW),it is widely
accepted that the internet,called the Fourth Media,will be the most potential
and energetic media after newspaper,radio and television as an important carrier of the hot society news.In order to know the internet hot news in time,the related organizations introduced the hot news and analysis system. The news spider system is in the information collection layer and is the fundamental part of hot news analysis system.It is responsible for the information collection .
In the help of related technologies and tools and with the needs of the system itself ,the paper discuss the concrete realization of the code module in detail .
The data of the news spider system comes from news of sina . First using web crawler to get data from news to local database , finally visualize the public opinion information on the front page. This article mainly has carried on the following several aspects work:
1) Using Java and HTTPClient developed a scalable web crawler which focus on DISCUZ BBS. Besides, this crawler can conduct a comprehensive orientation of fetching and periodic increment of fetching from BBS data (including the BBS post information and all its replies) under breadth-first strategy.
2)Using HTMLParser to extract meta-data from the BBS information, parsed and stored the meta-data, such as number, title, content, poster, posting time and the corresponding reply in a SQL Server database.
3) front-end interface combined with the use of open source AJAX framework ExtJS Servlet be achieved, taking into account the diversity of user interaction and system cross-browser compatibility.
By using this news crawling system, users can real-time news and information updated, timely, comprehensive and accurate grasp of hot news developments, improve the handling capacity of major emergencies, for more timely and comprehensive understanding of an important real-time information across significance.
Key Words: Hot news,Web crawler,Metadata extraction,Visualization
目录
1 绪论 1
1.1 开发背景及目的 1
1.2 国内外相关研究现状 3
1.3 论文主要内容和章节安排 4
2 系统开发知识准备 6
2.2 J2EE技术简介 7
2.3 SQL Server 2005简介 8
2.4 ExtJS简介 10
2.5开源工具简介 12
2.5本章小结 13
3 系统需求分析 14
3.1 系统可行性研究 14
3.2 用户对象分析 15
3.3 用户用例分析 16
3.4 功能需求分析 20
3.5 性能需求分析 21
3.6 本章小结 21
4 系统总体设计 23
4.1 数据库结构设计 23
4.2 系统功能模块设计 25
4.3 本章小结 31
5 系统详细设计与实现 32
5.1 数据获取模块 32
5.2 数据可视化模块 36
5.3 本章小结 43
6 系统测试与发布 44
6.1 软件测试的目标和方法 44
6.2 测试用例 45
6.3 本章小结 49
7 总结 50
参考文献 52
8 致谢词 53
附录1 英文原文 54
附录2 中文译文 64
1 绪论
本章主要阐明了该课题的研究背景及其研究意义,简要说明了国内外对于爬虫系统的研究现状,并介绍了本论文的主要内容组成以及论文的组织结构。
1.1 开发背景及目的
随着互联网技术的发展与应用的普及,网络作为信息的载体,已经成为社会大众参与社会生活的一种重要信息渠道。由于互联网是开放的,每个人都可以在网络上发表信息,内容涉及各个方面。小到心情日志,大到国家大事。互联网已成为思想文化信息的集散地,并具有传统媒体无法相比的优势:便捷性,虚拟性,互动性,多元性。
网络新闻热点通常形成迅速,多是人们对于日常生活中的各种问题发表的各种意见,评论,态度,情绪等,随着事件的发展而变化,是反映社会热点的重要载体之一。
网络爬虫是一种按照一定上网规则,自动的抓取万维网信息的程序或脚本。网络检索功能起于互联网内容爆炸性发展所带来的对内容检索的需求。搜素引擎不断发展,人们的需求也不断提高,网络信息搜索已经成为人们每天都有进行的内容。如何使搜索引擎能够时刻满足人们的需求?最初的检索功能通过索引站的方式实现,从而有了网络机器人。本课题来源于新闻爬虫系统项目的建设,旨在为相关机构提供及时的网络信息服务。这些服务与现有的搜索引擎提供的服务不同,其重要特征主要体现在:及时性,专用性,人性化。
1、 及时性
新闻爬虫系统通过爬虫技术自动爬取新闻信息,定期对相应类型的新闻的地址进行扫描,如若该新闻并未被爬取过则对其进行自动爬取。让系统的工作人员可以静观事态的发展。
2、 专用性
新闻爬虫系统的专用性体现在数据采集,数据分析,数据展现等几个环节上。在数据采集方面系统采用手动爬取与增量爬取相结合的方式。有针对性的采集需要的几个类别的新闻信息,并对信息进行抽取,去噪,结构化处理,为后续专用分析创造条件。在数据分析与数据展示方面,系统通过对得到的信息进行深入的分析,将分析结果进行多维度的展现。
3、 人性化
新闻爬虫系统的人性化主要体现在数据结果的展示上。 用户可以随时查看任意一个时间的新闻分析结果,而且该系统由于是基于多线程的程序完成任务的效率高。所以不管实在界面上还是在效率上都非常的人性化。
新闻
上一篇:
数据库大作业_-教务管理系统—华中科技大学
下一篇:
上海电气集团毕业实习报告