Git Product home page Git Product logo

Comments (2)

jae-jae avatar jae-jae commented on May 21, 2024 1

案例一 中符合采集规则的数据只有一条,所以采集结果只有一条,案例二符合采集规则的数据有多条,所以采集结果有多条;案例一中Array[0]中虽然有多条数据,但他们是一个整体,合起来是一条数据。

from querylist.

jayroe avatar jayroe commented on May 21, 2024

@jae-jae 很高兴能收到你的回信,感谢你对我提问的回答。只是读完回答后,我还是有点不明白。在案例一中,我写了三条采集规则,分别为'text','link'和'img',并且这三条采集规则都能采集到对应数据,为何你的回答中说,符合采集规则的数据只有一条?以下我将附上采集规则,期待你的下一次回复。

$rules = array(
    //采集id为one这个元素里面的纯文本内容
    'text' => array('#one','text'),
    //采集class为two下面的超链接的链接
    'link' => array('.two>a','href'),
    //采集class为two下面的第二张图片的链接
    'img' => array('.two>img:eq(1)','src'),
    //采集span标签中的HTML内容
    'other' => array('span','html')
);

from querylist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.