I'm looking for a solution using PHP/Dom to get number of links on each page. I use PHPDOM library and this is my own PHP code:
public function count_page_links($url = "https://www.rootdomain.com"){
$html = file_get_html($url);
foreach($html->find('a') as $link){
$headers = @get_headers($link->href);
if(strpos($headers[0], "200")){
}
}
}