#!/usr/bin/env python # -*- coding:utf-8 -*- import xlrd class IDImport: def element_Info(self, path): dic = {} file = open(path) for line in file: # # 去除首尾空格 list = [ele.strip() for ele in line.split("=")] # 将每行读出来,分割;list是列表 dic.update(dict([list])) return dic idImport=IDImport( ) neirong=idImport.element_Info( r"C:\Users\junjunbao\Desktop\学习应急资料 - 副本\elementid") print(neirong)
python+selenium,从文件中读入内容----常用语读取元素
最新推荐文章于 2022-10-25 00:36:52 发布