基于Scrapy的分布式网络新闻抓取系统设计与实现_马联帅.docx





《基于Scrapy的分布式网络新闻抓取系统设计与实现_马联帅.docx》由会员分享,可在线阅读,更多相关《基于Scrapy的分布式网络新闻抓取系统设计与实现_马联帅.docx(83页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 Design and Implementation of Distributed Netnews Crawling System Based on Scrapy A thesis submitted to XIDIAN UNIVERSITY in partial fulfillment of the requirements for the degree of Master in Computer Application Technology By Ma Lianshuai Supervisor: Yao Yong Associate Professor December 2015 摘要 在
2、互联网 快速发展的推 动下, 人类生 活的基本方式 己经悄然发生 改变。 以往的物 质交换方式、 信 息传播方式演变为新时代的 “ 非主流 ” , 互联网取而代 之成为社会生 活的必需品。 新 闻是生活中信息获取的最主要 途径之一, 随着网络的发展 和应用, 新 闻媒体己经演变 为传统媒体与网络媒体相融合 的新媒体, 大众获取新闻资 讯的途径不 断增多。 网络新 闻的时滞不断缩小, 使得更多 社会群体逐渐开始从互联网 上获取新闻 资讯, 基于网络 新闻的大数据前沿课题研究越 来越热, 科研领域对网络新 闻数据的需 求不断增多。 在 此背景下, 论文设计实现分布 式网络新闻抓取系统来抓取 网络新
3、闻数 据,为相关研宄提供数据支持。 基于研宄课题,论文介绍了网络爬虫的产生、发展和工作原理, Scrapy 爬虫框架 的结构和工作流程, Scrapy-Redis 的组成和各组件功能, Graphite 的相关概念。在 深入分析网络新闻爬虫特点的基础上,根据新闻网页特点设计爬虫爬取策略和提取字 段,在 Scrapy 框架的基础上,使用自定义下载中间件避免爬虫爬行时被网站屏蔽, 运用 Redis 数据库部署主从结构的分布式爬虫集群,提高数据抓取效率,运用 Graphite 实现系统状态可视化,运用 Selenium 解决了动态网页数据的抓取问题。文 中还设计编写了系统数据处理模块,主要包括数据清
4、洗、编码转换、对象添加、数据 分类等功能。为测试系统的性能,以腾讯网国内新闻、国际新闻、社会新闻以及军事 新闻四大新闻栏目为抓取目标,运行 10 小时,抓取了 3 万余条新闻内容和数百万条 评论信息。最后,本文通过三个基础数据分析实验,从新闻内容、网络媒体及用户评 论三个方面分析了包括舆论热点、时间维度的新闻特征、用户浏览偏好、媒体影响力、 评论用户性别特征、评论用户地区特征共六个网络新闻相关特征,从而验证了数据的 客观性、准确性和数据特征的多样性。 关 键 词 : 网 络 新 闻 , 分 布 式 爬 虫 , 数 据 处 理 , 数 据 分 析 ABSTRACT ABSTRACT With t
5、he rapid development of the Internet, the basic way of our daily life has been quietly changed. The Internet has become the cheapest and most efficient way to disseminate information and to exchange material. News report is one of the most important ways of information acquisition in our daily life.
6、 With the application and rapid development of network technology, not only has news media evolved into a new media merging by traditional media and Internet media, but also public access to getting news and information is growing continually. The time delay of the network news has shrunk so that mo
7、re social groups began to get news and information from the Internet. Meanwhile, researching on the big data frontier of the network news is becoming popular currently. From the intuitive point of view, the demand of network news data is increasing in the field of scientific research. In response, a
8、 distributed web crawler system is designed and implemented to extract the network news data in this paper, which provides sufficient support for our relevant research. Based on the research topic, this paper introduced the generation, development and operational principle of the web crawler, as wel
9、l as the structure and working flow of Scrapy framework, composition and function of each component of Scrapy-Redis, and concepts related to Graphite. This paper deeply analyzed the main characteristics of the crawler for network news, designed crawling strategy and extraction fields according to ch
10、aracteristics of webpages. Firstly, the system adopted Scrapy as the basic framework and deployed a custom download middleware to avoid being blocked by webs. To improve the efficiency of data crawling, it used Redis database to deploy distributed crawler with master-slave structure, using Graphite
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 Scrapy 分布式 网络新闻 抓取 系统 设计 实现 马联帅

限制150内