If you are a developer, just a developer in any language, and sometimes, you may require to count and see all links in a web page.
You can do that in a tricky way with developer console of any browser.
const links = document.querySelectorAll('a');
console.log(`Total links: ${links.length}`);
links.forEach((link, index) => {
console.log(`${index + 1}: ${link.href}`);
});Code language: JavaScript (javascript)
Just run inside “console” tab of browser with the link open. it will display the total number of links and display the urls too.
Leave a Reply