会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
布都御魂
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
25
下一页
2024年9月3日
代码或者网页源码中出现304状态码
摘要: 删除“If-Modified-Since” 和 “If-None-Match” 等条件请求头
阅读全文
posted @ 2024-09-03 10:28 布都御魂
阅读(18)
评论(0)
推荐(0)
2024年8月28日
去除空格
摘要: def clean_title_source_date(s): # 使用正则表达式去除回车符、制表符、换行符、全角空格和非断行空白符 cleaned = re.sub(r'[ \r\t\n\u3000\xa0来源:]', '', s) return cleaned
阅读全文
posted @ 2024-08-28 10:16 布都御魂
阅读(24)
评论(0)
推荐(0)
2024年7月10日
从MongoDB compass中导出某个时间段的数据
摘要: # 把结果复制到MongoDB compass上的查询位置# 点击export data# 点击Export query results# Select fields in table 选择需要导出的字段# 导出last=open('spider.results_dangdang.csv','r',
阅读全文
posted @ 2024-07-10 16:27 布都御魂
阅读(137)
评论(0)
推荐(0)
2024年6月24日
re.S的作用
摘要: import rea = """sdfkhellolsdlfsdfiooefo:877898989worldafdsf"""b = re.findall('hello(.*?)world',a)c = re.findall('hello(.*?)world',a,re.S)print ('b is
阅读全文
posted @ 2024-06-24 17:04 布都御魂
阅读(21)
评论(0)
推荐(0)
2024年3月22日
获取代理IP
摘要: # 流冠IP获取代理 # 提取订单 """ orderId:提取订单号 secret:用户密钥 num:提取IP个数 pid:省份 cid:城市 type:请求类型,1=http/https,2=socks5 unbindTime:使用时长,秒/s为单位 noDuplicate:去重,0=不去重,1
阅读全文
posted @ 2024-03-22 09:08 布都御魂
阅读(64)
评论(0)
推荐(0)
2024年3月5日
文件名报错:File doesn't exist Arg_ParamName_Name
摘要: 错误信息:File doesn't exist Arg_ParamName_Name 修改编发:把文件名改成从根目录开始
阅读全文
posted @ 2024-03-05 10:20 布都御魂
阅读(159)
评论(0)
推荐(0)
2023年12月6日
excel随机打乱排序
摘要: 随便新建一列 在第一行写上=rand(),确定,生成一个小数 鼠标悬浮在第一行右下角,出现黑色加黑的+,双击,点击排序,随便选一个排序方式
阅读全文
posted @ 2023-12-06 15:12 布都御魂
阅读(269)
评论(0)
推荐(0)
2023年11月13日
去除内容中的多余br标签
摘要: def br2_br1(content): content = re.sub('<br>(\s+)<br>', '', content) content = re.sub(r"(<br>)\1+", r"\1", content) content = re.sub("<br>", '<br><br>
阅读全文
posted @ 2023-11-13 09:14 布都御魂
阅读(56)
评论(0)
推荐(0)
取标签列表的最后两位,并去除最后一个逗号,没有标签就用标题
摘要: def update_biaoqian(tag_list, title): if tag_list == [''] or tag_list == []: print('没有标签,取标题作为标签') titless = re.sub('\s', ',', title) tag_list = title
阅读全文
posted @ 2023-11-13 09:13 布都御魂
阅读(29)
评论(0)
推荐(0)
把列表换成JSON格式,并根据键取值
摘要: def get_all(content, keyword): keys = [] values = [] for specs in keyword: num = keyword.index(specs) keys.append(specs) if num <= len(keyword) - 2: v
阅读全文
posted @ 2023-11-13 09:11 布都御魂
阅读(16)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
25
下一页
公告