Last active
August 29, 2015 14:05
-
-
Save azizur/1b82781164c171b21f5d to your computer and use it in GitHub Desktop.
Extract links from web page into a CSV format
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
var links = document.querySelectorAll("#prom-archives li>ul>li>ul>li a"); | |
var csvContent = "Post Title, URL \n"; | |
links.forEach(function(link, index){ | |
csvContent += [link.textContent.replace(","," - ") , link.href].join(",") + "\n"; | |
}); | |
var csv = document.createElement("textarea"); | |
csv.value = csvContent; | |
var el = document.querySelector(".entry-meta"); | |
el.appendChild( csv ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment