Given html like
<a href="http://wanlesstennis.com/junior" target="_blank" rel="noopener"> Wanless Park Tennis Club</a>
I get returned
[14] => simplehtmldom\HtmlNode Object
(
[nodetype] => HDOM_TYPE_ELEMENT (1)
[tag] => a
[attributes] => Array
(
[href] => http://wanlesstennis.com/junior
[target] => _blank
[rel] => noopener
)
[nodes] => none
)
Doesn't the anchor text get returned as an attribute with the link? My code is like
$html = $doc->load($url);
$links = [];
foreach($html->find('a') as $e){
$links[] = $e;
}
print_r($links);
I see.
One would use
$e->innertext
to get the text inside the tag.