当前位置:网站首页>使用dedecms自带采集功能的文字过滤与替换
使用dedecms自带采集功能的文字过滤与替换
2022-08-08 19:00:00 【米米素材网】
使用dedecms建站一般都会用到采集功能 这篇文章将为您讲述: 如何使用dedecms自带采集功能的文字过滤与替换的方法
1.去除超链接,这种最常用。
{dede:trim replace=”}<a([^>]*)>{/dede:trim} {dede:trim replace=”}</a>{/dede:trim} 如果填成这样,那就把链接的文本也一起去掉了
{dede:trim replace=”}<a([^>]*)>(.*)</a>{/dede:trim}
2.过滤JS调用广告,比如GG的广告,就加个这样的:
{dede:trim replace=”}<script([^>]*)>(.*)</script>{/dede:trim}
3.过滤div标签。
这个很重要,如果没过滤干净则可能使发布出来的文章版面错位, 目前大多数遇到采集后错位的原因在此。
{dede:trim replace=”}<div([^.]*)>{/dede:trim} {dede:trim replace=”}</div>{/dede:trim}
有的时候也需要这样子过滤:
{dede:trim replace=”}<div 选择器>(.*)</div>{/dede:trim}
4.其它的过滤规则可以照以上规律进行推出。 5.过滤摘要和关键字使用,经常要用到。
{dede:trim replace=”}{/dede:trim}
6.简单替换。 {dede:trim replace=’替换后的词语’}要替换的词语{/dede:trim}例子:{dede:trim replace="米米素材网"}服务器之家{/dede:trim} 采集的内容当然也要求搜索引擎收录, 过滤和替换目的是减少重复,进行伪原创,如何具体的操作,就看个人的要求与喜好了。
边栏推荐
- 商品期货需要多少钱开户。有资金门槛吗?期货开户在哪开安全?
- Implementing Forward+ in Unity URP
- APICloud AVM 封装日期和时间选择组件
- 疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
- 十六、一起学习Lua 文件 I/O
- 阿里云数据库PolarDB开源人才培养计划发布!万元好礼等你来拿!
- Fortinet new cloud native protection products launched amazon cloud platform of science and technology
- How is the private key generated by OpenSSH used in putty?
- 干货:从零设计高并发架构
- PyTorch入门:(一)数据加载
猜你喜欢
随机推荐
odoo 登录布局调整
view, index
【761. Special binary sequence】
Oracle--表
Implement the entire process of Mock API with tools
PG 之 huge page
达梦数据库 DmAPservice服务,启停影响 DMSERVER库服务吗?
BP神经网络
MogDB study notes - starting from 0
PyTorch入门:(五)模型的搭建
Monaco-Editor Multiplayer Collaboration Editor
我们想更换RDS数据库,从sqlserver 2016 web升级到 2017企业集群版,有专家咨询
MogDB学习笔记-从0开始
[BJDCTF2020]Easy MD5
ORACLE子查询 导致无法谓词推入的研究
We want to replace the RDS database and upgrade from sqlserver 2016 web to 2017 enterprise cluster version, with expert consultation
一起了解分层架构&SOA架构
PX4-做飞控二次开发需要知道的事情-Cxm
n个数取出r个数排列
Azure Neural TTS continues to be updated to help enterprises develop small language markets








