Skip to content

Commit

Permalink
use default value when content is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20b committed Dec 4, 2023
1 parent 287a030 commit 1aab6ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1aab6ca

Please sign in to comment.