search
Homephp教程php手册dede3.1分页文字采集过滤规则详说(图文教程)

dede3.1分页文字采集过滤规则详说(图文教程)

Jun 13, 2016 pm 12:32 PM
representbyPaginationGraphics and textTutorialletterhaveofrulefiltercollection

本文旨在以一个有代表性的文字分页的取样规则和过滤规则为蓝本,通过简单的变通和改动,解决一般性文字分页的采集问题

一、范例部分
范例分页区域代码:
范例分页区域代码:
=700) window.open('/upload/20074321296309.gif');" src="http://www.bkjia.com/uploads/allimg/131016/060F53N3-0.gif" onload="if(this.width>'700')this.width='700';" border=0>
范例分页区域取样代码:
  分页区域取样(匹配):
=700) window.open('/upload/20074321298864.gif');" src="http://www.bkjia.com/uploads/allimg/131016/060F52001-1.gif" onload="if(this.width>'700')this.width='700';" border=0>

范例分页内容过滤规则:
分页内容过滤规则:
=700) window.open('/upload/20074321298386.gif');" src="http://www.bkjia.com/uploads/allimg/131016/060F5B40-2.gif" onload="if(this.width>'700')this.width='700';" border=0>
范例采集内容预览:
范例采集内容预览:
=700) window.open('/upload/20074321298685.gif');" src="http://www.bkjia.com/uploads/allimg/131016/060F52939-3.gif" onload="if(this.width>'700')this.width='700';" border=0>

范例全代码(说明:此代码为在原基础上进行更改后的代码,原代码版本不同,直接导入后无效,因此在dede论坛中有许多朋友说过‘直接导入人家的代码都不能用',确实如此):
输出结果:http://wen.soudata.net/html/guizeceshi/caijibiji/20070327/2044_2.html
与原文比较下吧:http://www.xiaocao.com/text/class1/class1/200609/text_28623.html
这是全部的代码,可导入试下:

复制代码 代码如下:


{!-- 节点基本信息 --}

{dede:item name='论坛范例_工作总结_成功(改)'
    imgurl='/upimg' imgdir='../upimg' language='gb2312' typeid='1' macthtype='string'}
{/dede:item}

{!-- 采集列表获取规则 --}

{dede:list source='var' sourcetype='archives' 
          varstart='' varend=''}
  {dede:url value='http://www.xiaocao.com/text/class1/class1/200609/text_28623.html'}{/dede:url}    
  {dede:need}{/dede:need}
  {dede:cannot}{/dede:cannot}
  {dede:linkarea}[var:区域]{/dede:linkarea}
{/dede:list}

{!-- 网页内容获取规则 --}

{dede:art}
{dede:sppage sptype='full'}

[1][var:分页区域]{/dede:sppage}

  {dede:note field='dede_archives.title' value='[var:内容]' comment='文章标题' 
  isunit='' isdown=''}

    {dede:match}

[var:内容]{/dede:match}

    {dede:function}{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.sortrank' value='[var:内容]' comment='排序级别' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}@me = time();{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.writer' value='[var:内容]' comment='文章作者' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.litpic' value='[var:内容]' comment='缩略图' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}@me = @litpic;{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.pubdate' value='[var:内容]' comment='发布时间' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}if(@me!="") @me = GetMkTime(@me);
else @me = time();{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.senddate' value='[var:内容]' comment='录入时间' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}@me = time();{/dede:function}

  {/dede:note}

  {dede:note field='dede_addonarticle.body' value='[var:内容]' comment='文章内容' 
  isunit='1' isdown=''}

    {dede:match}<script></script>[var:内容]
{/dede:match}
        {dede:trim}

(.*)

{/dede:trim}

    {dede:function}{/dede:function}

  {/dede:note}

  {dede:note field='dede_archives.source' value='[var:内容]' comment='文章来源' 
  isunit='' isdown=''}

    {dede:match}{/dede:match}

    {dede:function}{/dede:function}

  {/dede:note}
{/dede:art}

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),