摘要: 举例: def test_003(): url = 'https://xx.com/user-login.html' # 启动浏览器 browser = webdriver.Chrome('/usr/local/bin/chromedriver') browser.get(url=url) brow 阅读全文
posted @ 2023-09-05 13:46 sunshine阿星 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 入参类型: def code_import(self, file_path, group_id, type): url = cf.base_url + url_api.url_serial_activation_import filename = file_path.split('/')[-1] h 阅读全文
posted @ 2023-09-04 17:40 sunshine阿星 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 方法一、通过接口获取 def test_002(): session = requests.session() get_url = 'https://Login/MDAccountLogin' data = { "password": "jTkwfEnaQeb9u5A1Gx6h3CwsfEVcOWP 阅读全文
posted @ 2023-08-30 16:25 sunshine阿星 阅读(627) 评论(0) 推荐(0) 编辑
摘要: None是一个对象,而NULL是一个类型。 Python中没有NULL,只有None,None有自己的特殊类型NoneType。None不等于0、任何空字符串、False等。在Python中,None、False、0、""(空字符串)、、()(空元组)、(空字典)都相当于False。 阅读全文
posted @ 2023-07-14 13:17 sunshine阿星 阅读(151) 评论(0) 推荐(0) 编辑
摘要: from configparser import ConfigParser class GetCfg: """ 读取配置文件方法 """ def __init__(self, config_file: str, section: [str, None] = None, key: [str, None 阅读全文
posted @ 2023-07-11 14:17 sunshine阿星 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 1. print()默认是print(end='\n') 如果不想换行可以print(end='') 2. 使print内容变成一行 print(end='\t') 3. 不设置指定位置,按默认顺序 "{} {}".format("hello", "world") eg 打印99乘法表 print( 阅读全文
posted @ 2023-07-06 17:44 sunshine阿星 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 安装第三方库 pip3 install opencv-python def scan_QR_opencv(): file_path = './file/data/screenshot.png' QR_image = cv2.imread(file_path) QR_detector = cv2.QR 阅读全文
posted @ 2023-07-06 17:40 sunshine阿星 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 拿到二维码 使用playwright方法,通过元素截图 https://playwright.dev/python/docs/screenshots 导入第三方库 pip3 install pyzbar from pyzbar.pyzbar import decode from PIL import 阅读全文
posted @ 2023-07-06 11:28 sunshine阿星 阅读(169) 评论(0) 推荐(0) 编辑
摘要: yaml文件类型 mysql: host: 127.0.0.1 user: test port: 35039 db: test password: 1234567 dp_ip: - 192.168.0.1 - 192.168.0.2 - 192.168.0.3 读取后结果为 {'mysql': {' 阅读全文
posted @ 2023-07-03 17:08 sunshine阿星 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 若仅转换时间格式使用strftime(),若需要做时间操作则使用strptime()。 strptime()中的p指parse(解析), 一般解析都是说对字符串进行解析, 所以strptime()方法是将字符串解析为时间元组。datetime.datetime.strptime() strftime 阅读全文
posted @ 2023-07-03 16:47 sunshine阿星 阅读(638) 评论(0) 推荐(0) 编辑