基于R语言的WEB半结构化数据抓取与统计分析
2016-10-14邓远飞甄晓云孟捷
邓远飞 甄晓云 孟捷
摘要:大数据时代,数据成为决策最重要的参考之一,通过数据抓取能够准确抓取我们需要的数据,然后挖掘出有用信息。本文以花卉网站为例,提出Web数据抓取与存储框架,实现了抓取Web网站中的半结构化数据,转换成结构化数据存储进数据库,并对数据进行预处理,然后运用数据分析和数据挖掘技术将结果展现出来,帮助花卉企业在花卉市场进行更准确的商业决策。
Abstract: In the era of big data, data become one of the most important references for decision-making. The data scraping can accurately capture the data we need, and then dig out the useful information. Based on flower website, this paper puts forward Web data scraping and storage framework. It realizes the semi-structured data in the Web sites, converts it into structured data and stores into the database, and carried put the preprocessing of the data. Then, it uses the data analysis and data mining technology to show the results and help the flowers enterprises take more accurate business decisions for flower market.
关键词:XML;XPath;R;半结构化;Web数据抓取;数据分析;数据挖掘
Key words: XML;XPath;R;semi-structured;Web data scraping;data analysis;data mining
中图分类号:TP311.1 文献标识码:A 文章编号:1006-4311(2016)05-0232-03
0 引言
随着Web信息技术的迅速发展,人们可以越来越方便快捷地获得各种信息,但是却难以迅速地获得更准确及适用的数据。虽然目前有多种查全率较高的搜索引擎,但它们的查准率普遍不高,很难进一步挖掘深度数据[1]。因此,研究如何对Web数据自动搜集及对搜集的数据的进行数据分析与挖掘具有重要现实意义。
本文将研究在花卉市场中Web数据挖掘[2]技术的应用,利用R软件编写数据抓取程序采集互联网上的花卉网站上的大量数据,并对数据进行预处理,然后运用数据分析和数据挖掘技术将结果展现出来,帮助花卉企业在花卉市场进行更准确的商业决策。
本文程序的开发环境基于R,完成了数据抓取、数据预处理和数据分析,使用MySQL数据库进行永久性数据存储。在R中对网页解析(XML、HTML文件,或包含 XML、HTML的字符串)有多种方法,比较成熟的方法是使用XML包。该程序包能够将XML、HTML网页树(tree)解析成R结构数据。……
