Skip to content

使用cheerio插件 不能套双层语法 #10

Open

Description

@developer-wlj

代码如下:
const $= load(res.data);
load(($('.torrentname .embedded:eq(1)',li).contents().not('[nodeType]=3'))[($('.torrentname .embedded:eq(1)',li).contents().not('[nodeType]=3')).length-1]).text().trim()

在电脑上用node测试能获取到文本,在app里提示content.forEach is not a function

image

Activity

  1. changed the title [-]使用cheerio插件是 不能套双层[/-] [+]使用cheerio插件 不能套双层语法[/+] on May 9, 2021
  2. developer-wlj commented on May 9, 2021

    @developer-wlj
    Author

    解决了 没有使用再套一层语法, 直接数组后面点 属性 就可以了 我前天试的不行 今天不知怎么又可以点了

  3. linroid commented on May 11, 2021

    @linroid
    Member

    @developer-wlj 可能是 content 为 null 了

  4. developer-wlj commented on May 14, 2021

    @developer-wlj
    Author

    @ developer-wlj可能是content为null了

    今天又遇到这个问题了,电脑的node能正常获取,用dora运行报错,能考虑下个版本更新修复吗,今天遇到的这个问题,我实在想不到,别的解决方法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions