Sup fellow diver, here’s a simple copypastatut on how to use vanilla JavaScript
to get RSS links from a webpage’s HTML documents and output them in the console of your browser. The script basically uses getElementsByTagName("link")
to select all link elements in the document, then iterates over them to find the ones with an attribute type="application/rss+xml"
. When it finds such link attributes, it then prints out the href
attribute of the link, which is the RSS feed URL.
Here are the steps:
Ctrl + Shift + i
on Windows and Linux, and Ctrl + Shift + i
on macOS, direct console access shortcut is Ctrl + Shift + j
).Console
.var links = document.getElementsByTagName("link");
for(var i = 0; i < links.length; i++) {
var link = links[i];
var linkType = link.getAttribute("type");
if(linkType === "application/rss+xml" || linkType === "application/rdf+xml" || linkType === "application/atom+xml") {
console.log(link.getAttribute("href"));
}
}
There you go, no go explore.