Created
July 31, 2024 04:39
-
-
Save tudoanh/c44a053ccd9db09b01c1f86a543a5d6f to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
'use strict'; | |
function collectUrls() { | |
const urlPattern = /^https:\/\/www\.linkedin\.com\/company\/[a-zA-Z0-9-]+\/?$/; | |
const links = document.querySelectorAll('a'); | |
const matchingUrls = []; | |
links.forEach(link => { | |
const href = link.href; | |
if (urlPattern.test(href)) { | |
matchingUrls.push(href); | |
} | |
}); | |
console.log("Matching URLs:", matchingUrls); | |
} | |
window.addEventListener('load', function() { | |
setTimeout(collectUrls, 3000); // Allow some time for dynamic content to load | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment