当前位置>主页 > 期刊在线 > 信息技术 >

信息技术2020年21期

基于Scrapy 爬虫框架的领域网站文件爬取
邹维,李廷元
(中国民用航空飞行学院 计算机学院,四川 广汉 618307)

摘  要:为了提高航行通告文件下载效率、节省人工资源,文章通过Scrapy 爬虫框架,结合自然语言处理中的信息,分类爬取各民航局发布的航行通告文本。首先基于网页数据交互模式将网站分类,结合Selenium 自动化测试工具进行网页下载。然后使用朴素贝叶斯算法将网站所有链接进行分类,区分为目标链接以及非目标链接,从而实现提取航行通告文本链接,此分类模型在领域类网站准确率为95.97%。


关键词:Scrapy;爬虫;Selenium;朴素贝叶斯



中图分类号:TP391         文献标识码:A         文章编号:2096-4706(2020)21-0006-04


Domain Website File Crawling Based on Scrapy Crawler Framework

ZOU Wei,LI Tingyuan

(School of Computer Science,Civil Aviation Flight University of China,Guanghan 618307,China)

Abstract:In order to improve the efficiency of downloading the notice to navigation document and save human resources,the article uses the Scrapy crawler framework combined with the information in natural language processing to classify and crawl the text of navigation notices issued by civil aviation administration. Firstly,web sites are classified based on web data interaction mode,and then web pages are downloaded with Selenium automated testing tool. Then the Naive Bayes algorithm is used to classify all the links of the website into target link and non-target link,so as to extract the text link of the notice of navigation. The accuracy rate of this classification model in the domain website is 95.97%.

Keywords:Scrapy;crawler;Selenium;Naive Bayes


参考文献:

[1] 田亚琳. 关于在机场设施改造期间做好航空情报信息前置的建议 [J]. 民航管理,2017(9):51-53.

[2] 陈凤兰. 基于模糊评价的航行通告质量评估方法 [J]. 科技创新与应用,2020(9):134-136.

[3] 王海玲,周志彬. 基于Scrapy 框架的爬虫设计 [J]. 软件导刊,2020,19(4):224-228.

[4] 王芳,张睿,宫海瑞. 基于Scrapy 框架的分布式爬虫设计与实现[J]. 信息技术,2019(3):96-101.

[5] 安子建. 基于Scrapy 框架的网络爬虫实现与数据抓取分析 [D]. 长春:吉林大学,2017.

[6] 虫师.Selenium 2 自动化测试实战 [M]. 北京:电子工业出版社,2016.

[7] 余芳,姜云飞. 一种基于朴素贝叶斯分类的特征选择方法 [J]. 中山大学学报(自然科学版),2004(5):118-120.

[8] FRIEDMAN N,GEIGER D,GOLDSZMIDT M.BayesianNetwork Classifiers [J].Machine Learning,1997,29(2-3):131-163.


作者简介:

邹维(1996—),女,汉族,四川宜宾人,硕士研究生,研究方向:机器学习自然语言处理;

李廷元(1967—),男,汉族,四川眉山人,教授,硕士研究生,研究方向:大数据分析、机器学习、人工智能。