From e43db7fd25798616ad38a959bd378bb765b9323c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 11 Feb 2016 20:02:30 +0100 Subject: support base href --- src/phinde/LinkExtractor/Html.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/phinde') diff --git a/src/phinde/LinkExtractor/Html.php b/src/phinde/LinkExtractor/Html.php index a6fa8ef..7b987e3 100644 --- a/src/phinde/LinkExtractor/Html.php +++ b/src/phinde/LinkExtractor/Html.php @@ -22,6 +22,13 @@ class Html $dx = new \DOMXPath($doc); + $xbase = $dx->evaluate('/html/head/base[@href]')->item(0); + if ($xbase) { + $base = $base->resolve( + $xbase->attributes->getNamedItem('href')->textContent + ); + } + $meta = $dx->evaluate('/html/head/meta[@name="robots" and @content]') ->item(0); if ($meta) { -- cgit v1.2.3