python基础python处理纯文本内容添加html标签应用场景 可能是语音、orc识别图片获取来的文本,没有html标签,此时可以用python给段落添加标签。 方式一 固定字数加标 ...2022-10-26
python基础python计算字符串长度(纯中文)def get_content_wordnumber(html): text =re.sub('[\s+\.\!\/_,$%^*(+\"\']+|[+——!,::。?、~@#¥%……&*()“” ...2022-10-21
python爬虫python格式化html代码的方法有时候采集下来的内容杂乱无章,常见的p标签,span标签里面带有各种属性,或者携带一些unicode编码,使用该函数可以直接格式 ...2022-10-14
python基础python计算带html标签的字符串纯中文字数def get_content_wordnumber(html): text = re.sub("[+/_,$%^*(+\"]+|[+——!,::。?、~@#¥%……&*()“”《》]+", ...2022-10-03
python爬虫request常用html页面下载函数import requests headers ={} def download(url,retires: int = 10): try: r = requests.get(url, headers= ...2022-10-03
python爬虫request常用json下载函数import requests headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, ...2022-10-03