摘要: 如果速度比较慢,这里也可以使用国内镜像源: 一些国内常用的 Python 镜像源有:豆瓣:https://pypi.douban.com/simple/阿里云:https://mirrors.aliyun.com/pypi/simple/华中理工大学:https://pypi.hustunique. 阅读全文
posted @ 2024-08-12 11:26 究极不吃香菜 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 生成浏览器插件扩展程序,在启动driver时加载插件 extension_path 插件路径 driver.install_addon(path=extension_path,temporary=True)#添加扩展 fixfox chrome_options.add_extension(exten 阅读全文
posted @ 2024-06-12 10:41 究极不吃香菜 阅读(36) 评论(0) 推荐(0) 编辑
摘要: pattern = 'fsafasfs4gsag6asght4' result = ''.join(re.findall(r'\d+', pattern)) print(result) 阅读全文
posted @ 2024-06-04 15:15 究极不吃香菜 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #接下来是全屏的关键,用js获取页面的宽高,如果有其他需要用js的部分也可以用这个方法width = driver.execute_script("return document.documentElement.scrollWidth")height = driver.execute_script( 阅读全文
posted @ 2024-03-06 10:43 究极不吃香菜 阅读(33) 评论(0) 推荐(0) 编辑
摘要: import os, sysimport re #1.列出不同的键值 reload(sys) sys.setdefaultencoding("utf8") dct0 = {"name":"zhang","age":"23"} dct1 = {"name":"san","age":"23"} def 阅读全文
posted @ 2023-06-08 15:05 究极不吃香菜 阅读(117) 评论(0) 推荐(0) 编辑
摘要: css概述: 1.css(Cascading Style Sheets)是一种语言,它用来描述HTML和XML的元素显示样式。 2.css语言中有css选择器,在selenium中可以使用这种选择器来进行元素定位。 3.css定位方法比xpath快,而且css语言也非常强大,所以非常推荐这种定位方法 阅读全文
posted @ 2023-05-09 17:22 究极不吃香菜 阅读(2002) 评论(0) 推荐(0) 编辑
摘要: 调用JS语法需要用到selenium中的方法 execute_script() ,参数直接填写JS语法。 # 1、通过元素id属性,获取元素 document.getElementById('id'); # 2、通过元素name属性,获取元素列表 document.getElementsByName 阅读全文
posted @ 2023-05-09 17:09 究极不吃香菜 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 这里以上传图片为例 找到上传按钮附近的input元素下type=file selenium直接执行代码 file_path = r'C:\Users\Administrator\Desktop\imge\xxxxxx.jpg'需要上传的图片路径 upload_div_loc = 'input[typ 阅读全文
posted @ 2023-04-11 15:42 究极不吃香菜 阅读(23) 评论(0) 推荐(0) 编辑
摘要: import calendar #数字转为月份简写 date_list = [1,2,3,4,5,6,7,8,9,10,11,12] for i in date_list: print(calendar.month_abbr[i]) date_list = [1,2,3,4,5,6,7,8,9,10 阅读全文
posted @ 2022-09-28 16:18 究极不吃香菜 阅读(259) 评论(0) 推荐(0) 编辑
摘要: application/vnd.hzn-3d-crossword;video/3gpp;video/3gpp2;application/vnd.mseq;application/vnd.3m.post-it-notes;application/vnd.3gpp.pic-bw-large;applic 阅读全文
posted @ 2022-08-10 09:31 究极不吃香菜 阅读(167) 评论(0) 推荐(0) 编辑