摘 要:随着电子商务的飞速发展,很多国有企业针对日常工作中用到的高频易耗标准品搭建了电子超市采购平台。由于电子超市商品多种多样,商品信息变更记录无法实时查询,故采购执行过程中,多个环节采购人员需要在多个平台对计划采购的商品关键信息进行查询更新,从而及时调整采购策略。文章基于 Selenium 设计自动处理程序,实现了关键信息自动查询和记录的功能,阐述了使用 Selenium 实现浏览器控制、数据自动查询、关键信息写入工作表,商品页面截屏备查的方法。
关键词:电子超市;Selenium;自动查询;自动截图
DOI:10.19850/j.cnki.2096-4706.2022.22.003
中图分类号:TP311 文献标识码:A 文章编号:2096-4706(2022)22-0012-05
Design and Implementation of Automatic Program Based on Selenium
WANG Xuli
(Chnenergy (Tianjin) Port Co., Ltd., Tianjin 300456, China)
Abstract: With the rapid development of E-commerce, state-owned enterprises have built their own procurement platforms, and businesses have built E-supermarket procurement platforms for enterprises that use high-frequency consumables in their daily work. Due to the variety of commodities in the electronic supermarket, the change records of commodity information cannot be queried in real time, so during the purchase implementation process, key information of the commodities planned to be purchased needs to be queried and updated on multiple platforms by purchasing personnel in multiple purchasing links, so as to adjust the purchase strategy in a timely manner. This paper designs an automatic processing program based on Selenium to realize the function of automatic query and record of key information. It also describes the method of using Selenium to realize browser control, automatic query of data, writing key information into worksheet, and screen capture of product page for future reference.
Keywords: electronic supermarket; Selenium; automatic query; automatic screenshot
参考文献:
[1] 虫师 .Selenium3 自动化测试实战基于 Python 语言 [M].北京:电子工业出版社,2019.
[2] 昂米沙 • 冈迪察 .Selenium 自动化测试——基于 Python语言 [M]. 北京:人民邮电出版社,2018.
[3] 赵卓 .Selenium 自动化测试指南 [M]. 北京:人民邮电出版社,2013.
[4] 马孝宗,王雪山 . 基于 Python 检查 EAM 系统数据规范性 [J]. 现代信息科技,2022,6(3):92-94.
[5] 张冬梅,徐东镪 . 一种基于 Python 的动环告警大数据资源稽核方法 [J]. 现代信息科技,2021,5(22):34-37.
[6] 王志飞,梁晓琳,张宇奇 .“互联网 + 支教”平台的设计与实现 [J]. 现代信息科技,2022,6(3):9-13+17.
作者简介:王旭丽(1986—),女,汉族,山西长治人,中级工程师,硕士,研究方向:电商采购、数据管理。