QueryList is what is the collection?

Collect the title and link of the Baidu search result list.

 $data = QueryList::get('https://www.baidu.com/s?wd= QueryList')
      // Set collection rules
      ->rules([
          ‘Title’=>array(‘h3’,‘text’),
          ‘Link’=>array(‘h3>a’,‘href’)
      ])
      ->queryData();

  print_r($data);

  Collection results:

 Array
  (
    [0] => Array
        (
            [title] => QueryList|An extremely powerful PHP collection tool based on phpQuery
            [link] => http://www.baidu.com/link?url=GU_YbDT2IHk4ns1tjG2I8_vjmH0SCJEAPuuZN
        )
    [1] => Array
        (
            [title] => PHP uses QueryList to grab web content-wb145230-博客园
            [link] => http://www.baidu.com/link?url=zn0DXBnrvIF2ibRVW34KcRVFG1_bCdZvqvwIhUqiXaS
        )
    [2] => Array
        (
            [title] => Introduction-QueryList guide document
            [link] => http://www.baidu.com/link?url=pSypvMovqS4v2sWeQo5fDBJ4EoYhXYi0Lxx
        )
        //...
  )

  Marble component

 $data = QueryList::get('https: //www.baidu.com/s?wd=QueryList')
      // Set collection rules
      ->rules([
          ‘Title’=>array(‘h3’,‘text’),
          ‘Link’=>array(‘h3>a’,‘href’)
      ])
      ->queryData();

  print_r($data);

 Array
  (
    [0] => Array
        (
            [title] => QueryList|An extremely powerful PHP collection tool based on phpQuery
            [link] => http://www.baidu.com/link?url=GU_YbDT2IHk4ns1tjG2I8_vjmH0SCJEAPuuZN
        )
    [1] => Array
        (
            [title] => PHP uses QueryList to grab web content-wb145230-博客园
            [link] => http://www.baidu.com/link?url=zn0DXBnrvIF2ibRVW34KcRVFG1_bCdZvqvwIhUqiXaS
        )
    [2] => Array
        (
            [title] => Introduction-QueryList guide document
            [link] => http://www.baidu.com/link?url=pSypvMovqS4v2sWeQo5fDBJ4EoYhXYi0Lxx
        )
        //...
  )

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2004 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.