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

信息技术2020年5期

​基于 Selenium 框架的电力系统数据爬取应用研究
余凯,汤渊,黎海震,夏伟轩
(广东电网公司东莞供电局 供电服务中心,广东 东莞 523000)

摘  要:为了从大量数据中快速,高效地提取出有用的数据以方便数据分析。利用 Python 语言中的 Selenium 库是目前广泛应用于爬虫设计的一种方法,以其代码精简,拾取方便且效率较高等特点,应用于绝大部分企业的数据挖掘平台中。通过应用Python 和 Selenium 的方法实现了数据的提取,并通过使用异常捕抓、函数封装,统一调用实现了数据的导出和上传的自动化,结果表明使用 Selenium 爬虫会优于网页爬虫。


关键词:Selenium;异常处理;爬虫;电力系统



中图分类号:TP311.5         文献标识码:A         文章编号:2096-4706(2020)05-0026-04


Research on Application of Power System Data Crawler Based on Selenium Framework

YU Kai,TANG Yuan,LI Haizhen,XIA Weixuan

(Power Supply Service Center of Dongguan Power Supply Bureau of Guangdong Power Grid Company,Dongguan 523000,China)

Abstract:In order to extract useful data from a large number of data quickly and efficiently to facilitate data analysis. Using the Selenium library in Python language is a method widely used in crawler design at present. It is used in the data mining platform of most enterprises because of its simple code,convenient picking and high efficiency. The method of Python and Selenium is used to extract the data,and the automation of data export and upload is realized by using exception capture,function encapsulation and unified call. The results show that Selenium crawler is better than web crawler.

Keywords:Selenium;abnormal jump catch;web crawler;electric system


参考文献:

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

[2] 樊涛,赵征,刘敏娟 . 基于 Selenium 的网络爬虫分析与实现 [J]. 电脑编程技巧与维护,2019(9):155-156+170.

[3] 花君林 . 基于 Selenium 的 Python 网络爬虫的实现 [J].电脑编程技巧与维护,2017(15):30-31+36.

[4] 杜彬 . 基于 Selenium 的定向网络爬虫设计与实现 [J]. 金融科技时代,2016(7):35-39.

[5] 刘洋,田儒贤,唐兰文 . 基于 WebDriver 技术的定向网络爬虫研究 [J]. 电脑知识与技术,2020,16(3):34-36.

[6] 陈清 . 基于 Python 的网站爬虫应用研究 [J]. 通讯世界,2020,27(1):202-203.

[7] 楼姗姗 . 大数据环境下基于 python 的网络爬虫技术探讨 [J]. 决策探索(中),2019(11):92.

[8] 朱梓熙,吴文庆 . 一种智能自动获取信息的方法——以获取养老机构信息为例 [J]. 科技创新发展战略研究,2020,4(1):47-51.

[9] 庄文龙,陈惠娟 . 基于 Selenium2 的自动化测试应用 [J].福建电脑,2019,35(8):89-91.

[10] 李瑞,徐家喜 . 基于 selenium2 的自动化测试系统的设计和实现 [J]. 福建电脑,2018,34(7):26-27+2.

[11] 冯晶晶 . 基于 Selenium 的 Web 自动化测试框架的设计与实现 [D]. 北京:北京工业大学,2018.

[12] 刘瑾 .Web 系统 Selenium WebDriver 自动化测试框架搭建 [J]. 电子技术与软件工程,2017(21):171-172.


作者简介:余凯(1978-),男,汉族,广东湛江人,电力工程师,本科,研究方向:电力营销。