Last active
July 26, 2019 09:03
-
-
Save madeingnecca/6805e87f98e41dc407f0ca8bcba72ef2 to your computer and use it in GitHub Desktop.
Semrush print hierarchy (source)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var data = {}, html, url, i; | |
$('td.sa-sortingColumn a').each(function() { | |
var url = $.trim($(this).attr('title')); | |
data[url] = $(this).closest('tr').find('td.sa-ta-left a').map(function() { | |
return $(this).attr('href'); | |
}).get(); | |
}); | |
html = ''; | |
html += '<ul>'; | |
for (url in data) { | |
html += '<li>'; | |
html += '<span>' + url + '</span>'; | |
html += '<ul>'; | |
for (i = 0; i < data[url].length; i++) { | |
html += '<li>' + data[url][i] + '</li>'; | |
} | |
html += '</ul>'; | |
html += '</li>'; | |
} | |
html += '</ul>'; | |
var b=window.open(); | |
b.document.write(html); | |
b.document.close() | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment