上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: 一、使用selenium的webdirver模块对浏览器进行操作 注意:需要安装浏览器版本对应的driver驱动 from selenium import webdriver b = webdriver.Firefox() b.get('https://www.baidu.com') #打开一个网页 阅读全文
posted @ 2019-12-26 21:03 忆梦,惊梦 阅读(385) 评论(0) 推荐(0)
摘要: 安装Firefox驱动GeckoDriver 1、下载geckodriver https://github.com/mozilla/geckodriver/releases 2、将解压后得到的geckodriver.exe放到Python安装路径下,如: #使用selenium打开firefox浏览 阅读全文
posted @ 2019-12-26 20:49 忆梦,惊梦 阅读(324) 评论(0) 推荐(0)
摘要: 1、执行test文件夹下的testA和testB import os path = "/Users/ddc-test/Downloads/pycharm/test" lst = os.listdir(path) for c in lst: if c.endswith('.py') and c.fin 阅读全文
posted @ 2019-12-19 14:53 忆梦,惊梦 阅读(1192) 评论(0) 推荐(0)
摘要: 一、安装XlsxWriter模块pip install XlsxWriter二、常用方法 import xlsxwriter import datetime workbook = xlsxwriter.Workbook("new_excel.xlsx") #创建Excel worksheet = w 阅读全文
posted @ 2019-12-17 15:05 忆梦,惊梦 阅读(1943) 评论(0) 推荐(0)
摘要: 一、安装xlrd模块 二、常用方法 1、导入模块 import xlrd 2、打开文件 x1 = xlrd.open_workbook("testCase.xlsx") 3、获取sheet print('sheet_names:', x1.sheet_names()) # 获取所有sheet名字 p 阅读全文
posted @ 2019-12-17 14:36 忆梦,惊梦 阅读(1566) 评论(0) 推荐(0)
摘要: 表单参数提交:Content-Type:application/x-www-form-urlencoded内容:key1=value1&key2=value2requests.post(url,data={'key1':'value1','key2':'value2'})json参数提交:Conte 阅读全文
posted @ 2019-12-13 18:15 忆梦,惊梦 阅读(454) 评论(0) 推荐(0)
摘要: 一、基本的读取操作: -read(filename) 直接读取文件内容 -sections() 得到所有的section,并以列表的形式返回 -options(section) 得到该section的所有option -items(section) 得到该section的所有键值对 -get(sec 阅读全文
posted @ 2019-12-13 15:29 忆梦,惊梦 阅读(516) 评论(0) 推荐(0)
摘要: 1、安装模块pip3 install pymysql 2、使用操作 import pymysql #创建连接 conn = pymysql.connect(host='xxx.xxx.xxx.xx',port = 3306,user = 'test',passwd = '******',db = ' 阅读全文
posted @ 2019-12-12 17:41 忆梦,惊梦 阅读(682) 评论(0) 推荐(0)
摘要: List操作,redis中的List在内存中按照一个name对应一个List来存储。 lpush(name,valus)在name对应的list中添加元素,每个新的元素都添加到列表的最左边如:r.lpush('oo',11,22,33) 保存顺序为:33,22,11扩展:rpush(name,val 阅读全文
posted @ 2019-12-12 15:32 忆梦,惊梦 阅读(1626) 评论(0) 推荐(0)
摘要: Redis redis是一个key-value存储系统。 赋值:set name alex查看所有key:keys *查看key对应的value:get name只存活2秒钟:set name jack ex 2 Python操作Redissudo pip install redis 1、操作模式r 阅读全文
posted @ 2019-12-11 17:16 忆梦,惊梦 阅读(863) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页