摘要: # 二分法算法def binary_search(arr, num): if len(arr)==0: print('该值不存在') return False mid = int(len(arr)/2) print(mid) if arr[mid] > num: arr = arr[:mid-1] 阅读全文
posted @ 2021-07-03 01:12 jasonchenYT 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 【个人理解】 赋值后的变量还是指向相同的内存地址,也不算叫变量,相当于原有列表的别名或标签名。 浅拷贝:浅拷贝只会拷贝原列表最外层(父层),且套的列表指向的内存地址还是和原列表一致。原来的列表操作父层没有关系,操作子层会和原列表一致。 深拷贝:深拷贝会把父层子层都重新有新的内存地址,原来的列表操作和 阅读全文
posted @ 2021-06-21 15:30 jasonchenYT 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 【测试环境】 hashlib 内置库 requsts 2.25.1 # pip install requests python 3.9.5 【代码实现】 import requestsimport hashlibimport jsonpath class ActionInterfaceTest(ob 阅读全文
posted @ 2021-06-01 16:31 jasonchenYT 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 【环境】 xlwt :1.3 python:3.9.5 【代码示例】 import osimport reimport xlwtdef robot_file_xls_utils(): current_path = os.path.dirname(__file__) file_path = os.pa 阅读全文
posted @ 2021-05-28 19:32 jasonchenYT 阅读(154) 评论(0) 推荐(0) 编辑
摘要: # 提示框的处理import timefrom selenium import webdriverdriver = webdriver.Chrome()driver.get('https://www.baidu.com')driver.maximize_window()driver.implicit 阅读全文
posted @ 2020-12-15 01:24 jasonchenYT 阅读(147) 评论(0) 推荐(0) 编辑
摘要: import timefrom selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.select import Selectdriver = webdr 阅读全文
posted @ 2020-12-14 01:03 jasonchenYT 阅读(17) 评论(0) 推荐(0) 编辑
摘要: # ifame 框架切换# 知识点:切换框架 driver.switch_to.frame(id & name),返回默认框架:driver.switch_to.default_content()# 熟悉使用By来定位元素 CSS_SELECTOR和XPATHimport timefrom sele 阅读全文
posted @ 2020-12-14 01:02 jasonchenYT 阅读(78) 评论(0) 推荐(0) 编辑
摘要: # 层级定位import timefrom selenium.webdriver.common.by import Byfrom selenium.webdriver.common.action_chains import ActionChainsfrom selenium import webdr 阅读全文
posted @ 2020-12-14 01:00 jasonchenYT 阅读(55) 评论(0) 推荐(0) 编辑
摘要: import timefrom selenium.webdriver.common.by import Byfrom selenium.webdriver.common.action_chains import ActionChainsfrom selenium import webdriverdr 阅读全文
posted @ 2020-12-14 00:58 jasonchenYT 阅读(39) 评论(0) 推荐(0) 编辑
摘要: # 1 sleep():固定休眠时间设置,python的time包里提供了休眠方法sleep,# 导入包time后就能使用;# sleep()方法以秒为单位,如果超时设置小于1秒,可以使用小数import timefrom selenium.webdriver.common.by import By 阅读全文
posted @ 2020-12-14 00:56 jasonchenYT 阅读(45) 评论(0) 推荐(0) 编辑