摘要:
# 把所有br标签换成一个br标签content = re.sub(r"(<br>)\1+", r"\1", content)# 把一个换成2个br标签content = re.sub("<br>", '<br><br>', content)print(f'展示图片原图片:{picurl}') 阅读全文
摘要:
删除内容中的表情符号 import emoji import re def del_emoji(text): text = emoji.demojize(text) result = re.sub(':\S+?:', ' ', text) result = result.replace("(●'◡' 阅读全文
摘要:
# 提取img标签 tree_img = etree.HTML(content) width = tree_img.xpath('//img//@width')[0] height = tree_img.xpath('//img//@height')[0] # 替换掉width=,和height= 阅读全文
摘要:
import hashlib import random import re import time from lxml import etree import pymysql import requests def strip_tags(string, allowed_tags=''): if a 阅读全文
摘要:
list1 = ['组', '2023-1-1', '2023-1-2', '2023-1-3', '总业绩'] list2 = ['一组', '1', '2', '3', '6'] list3 = ['二组', '4', '5', '6', '15'] list4 = ['三组', '7', '8 阅读全文
摘要:
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 阅读全文
摘要:
def strip_tags(string, allowed_tags=''): if allowed_tags != '': # Get a list of all allowed tag names. allowed_tags = allowed_tags.split(',') allowed_ 阅读全文
摘要:
import hashlib import random import re import ssl import requests import time from lxml import etree import pymysql import requests from hashlib impor 阅读全文
摘要:
在下载模块语句后面加上-i 镜像源 清华:https://pypi.tuna.tsinghua.edu.cn/simple/阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学:https://mirrors.tuna.tsinghua.edu.cn/py 阅读全文
摘要:
import hashlib import random import re import time from lxml import etree import pymysql import requests import warnings warnings.filterwarnings("igno 阅读全文