【问题标题】:Multiple selections in jQuery/CheeriojQuery/Cheerio 中的多项选择
【发布时间】:2023-04-04 01:54:01
【问题描述】:

我正在写一个刮板,我需要它来排除第一个孩子和第七个孩子。我可以选择 not(:first-child) 和 not(:nth-child(7))。 JQuery 或 Cheerio 中是否有 and 运算符(类似于 or 的逗号)。由于这个刮板的性质,我不能使用德摩根定律

【问题讨论】:

    标签: jquery web-scraping cheerio


    【解决方案1】:

    你应该能够把它们放在一起:

    $('li:not(:first-child):not(:nth-child(7)')
    

    【讨论】:

      猜你喜欢
      • 2015-12-18
      • 2015-12-15
      • 2017-02-01
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 2014-01-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多