上一页 1 2 3 4 5 6 7 8 ··· 25 下一页
摘要: import pandas as pdimport numpy as nppath = '产业布局-企业.xlsx'# 详情页链接title = pd.read_excel(path, usecols=[2])title_arr = np.asarray(title.stack()) # Dataf 阅读全文
posted @ 2023-08-28 14:15 布都御魂 阅读(156) 评论(0) 推荐(0)
摘要: def update_biaoqian(tag_list, title): if tag_list==[''] print('没有标签,取标题作为标签') titless = re.sub('\s', ',', title) tag_list = title.replace('、', ',').re 阅读全文
posted @ 2023-08-24 14:16 布都御魂 阅读(33) 评论(0) 推荐(0)
摘要: def del_nt(title_list): title_new = [] for title_old in title_list: title = re.sub('\s', '', title_old) if title == '': pass else: title_new.append(ti 阅读全文
posted @ 2023-08-23 10:43 布都御魂 阅读(15) 评论(0) 推荐(0)
摘要: 内容里有特殊字符,用re.escape(pattern)转义一下 阅读全文
posted @ 2023-07-27 15:27 布都御魂 阅读(457) 评论(0) 推荐(1)
摘要: # 把所有br标签换成一个br标签content = re.sub(r"(<br>)\1+", r"\1", content)# 把一个换成2个br标签content = re.sub("<br>", '<br><br>', content)print(f'展示图片原图片:{picurl}') 阅读全文
posted @ 2023-07-25 16:46 布都御魂 阅读(49) 评论(0) 推荐(0)
摘要: 删除内容中的表情符号 import emoji import re def del_emoji(text): text = emoji.demojize(text) result = re.sub(':\S+?:', ' ', text) result = result.replace("(●'◡' 阅读全文
posted @ 2023-07-19 16:29 布都御魂 阅读(95) 评论(0) 推荐(0)
摘要: # 提取img标签 tree_img = etree.HTML(content) width = tree_img.xpath('//img//@width')[0] height = tree_img.xpath('//img//@height')[0] # 替换掉width=,和height= 阅读全文
posted @ 2023-07-14 09:58 布都御魂 阅读(108) 评论(0) 推荐(0)
摘要: import hashlib import random import re import time from lxml import etree import pymysql import requests def strip_tags(string, allowed_tags=''): if a 阅读全文
posted @ 2023-07-12 16:00 布都御魂 阅读(53) 评论(0) 推荐(0)
摘要: list1 = ['组', '2023-1-1', '2023-1-2', '2023-1-3', '总业绩'] list2 = ['一组', '1', '2', '3', '6'] list3 = ['二组', '4', '5', '6', '15'] list4 = ['三组', '7', '8 阅读全文
posted @ 2023-07-11 16:45 布都御魂 阅读(29) 评论(0) 推荐(0)
摘要: list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # 输出结果[1,2,3][4,5,6][7.8.9] len_list = len(list) // 3 num_list = len(list) % 3 list_all = [] for num in range(l 阅读全文
posted @ 2023-07-11 16:09 布都御魂 阅读(13) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 25 下一页