diff --git a/src/DomCrawler/Crawler.php b/src/DomCrawler/Crawler.php index ee1a9363..d0239141 100644 --- a/src/DomCrawler/Crawler.php +++ b/src/DomCrawler/Crawler.php @@ -229,7 +229,7 @@ public function html(string $default = null): string return $this->webDriver->getPageSource(); } - return (string) $this->attr('outerHTML'); + return (string) $this->attr('outerHTML', $default); } catch (\InvalidArgumentException $e) { if (null === $default) { throw $e;