摘要: 1. “isdigit” 函数,判断字符串中是否全部为“数字”。 如果字符串中有一个不是数字, 则为False strs = "123" if strs.isdigit(): print("是数字") else: print("不是数字") 运行结果: >>>是数字 2. 判断字符串中是否包含“数字 阅读全文
posted @ 2022-03-09 18:29 博无止境 阅读(10707) 评论(0) 推荐(0) 编辑
摘要: # 将元组中的None值去掉,并转换为list input_= [('接口自动化测试用例', None, None, None, None, None, None)] output = [] for each in input_: newList = list(filter(None,each)) 阅读全文
posted @ 2022-03-09 17:40 博无止境 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 1. 启动手机模式浏览器, 手机型号只能选以下范围。 from selenium.webdriver.chrome.options import Options# 手机模式 # 设置手机型号,这设置为iPhone 6 mobile_emulation = {"deviceName": "iPhone 阅读全文
posted @ 2022-03-09 11:42 博无止境 阅读(1819) 评论(0) 推荐(0) 编辑