original_string: public function extract($attributes)
      {
          $attributes = (array) $attributes;
          $count = \count($attributes);
  
          $data = [];
          foreach ($this->nodes as $node) {
              $elements = [];
              foreach ($attributes as $attribute) {
                  if ('_text' === $attribute) {
                      $elements[] = $node->nodeValue;
                  } elseif ('_name' === $attribute) {
                      $elements[] = $node->nodeName;
                  } else {
                      $elements[] = $node->getAttribute($attribute);
                  }
              }
  
              $data[] = 1 === $count ? $elements[0] : $elements;
          }
  
          return $data;
      }
code: public function extract($attributes)
      {
          $attributes = (array) $attributes;
          $count = \count($attributes);
  
          $data = [];
          foreach ($this->nodes as $node) {
              $elements = [];
              foreach ($attributes as $attribute) {
                  if ('_text' === $attribute) {
                      $elements[] = $node->nodeValue;
                  } elseif ('_name' === $attribute) {
                      $elements[] = $node->nodeName;
                  } else {
                      $elements[] = $node->getAttribute($attribute);
                  }
              }
  
              $data[] = 1 === $count ? $elements[0] : $elements;
          }
  
          return $data;
      }
code_tokens: public function extract ( $ attributes ) { $ attributes = ( array ) $ attributes ; $ count = \ count ( $ attributes ) ; $ data = [ ] ; foreach ( $ this -> nodes as $ node ) { $ elements = [ ] ; foreach ( $ attributes as $ attribute ) { if ( '_text' === $ attribute ) { $ elements [ ] = $ node -> nodeValue ; } elseif ( '_name' === $ attribute ) { $ elements [ ] = $ node -> nodeName ; } else { $ elements [ ] = $ node -> getAttribute ( $ attribute ) ; } } $ data [ ] = 1 === $ count ? $ elements [ 0 ] : $ elements ; } return $ data ; }
docstring: Extracts information from the list of nodes.
  
  You can extract attributes or/and the node value (_text).
  
  Example:
  
  $crawler->filter('h1 a')->extract(['_text', 'href']);
  
  @param array $attributes An array of attributes
  
  @return array An array of extracted values
docstring_tokens: Extracts information from the list of nodes .