Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractBrowser.php

function AbstractBrowser::createCrawlerFromContent

Creates a crawler.

This method returns null if the DomCrawler component is not available.

1 call to AbstractBrowser::createCrawlerFromContent()
AbstractBrowser::request in vendor/symfony/browser-kit/AbstractBrowser.php
Calls a URI.

File

vendor/symfony/browser-kit/AbstractBrowser.php, line 506

Class

AbstractBrowser
Simulates a browser.

Namespace

Symfony\Component\BrowserKit

Code

protected function createCrawlerFromContent(string $uri, string $content, string $type) : ?Crawler {
    if (!class_exists(Crawler::class)) {
        return null;
    }
    $crawler = new Crawler(null, $uri, null, $this->useHtml5Parser);
    $crawler->addContent($content, $type);
    return $crawler;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal