Not That You Asked - How to extract a list of links from a webpage
Use Chrome
Be sure you're in a live environment. For example, in Penn Libraries Guides, this will not work in the editor.
Open Development Tools
- Press Command+Option+C (Mac) or Control+Shift+C (Windows, Linux, ChromeOS).
Click Console
At the bottom, after the arrow (>), paste in this code: var x = document.querySelectorAll("a");
var myarray = []
for (var i=0; i<x.length; i++){
var nametext = x[i].textContent;
var cleantext = nametext.replace(/\s+/g, ' ').trim();
var cleanlink = x[i].href;
myarray.push([cleantext,cleanlink]);
};
function make_table() {
var table = '<table><thead><th>Name</th><th>Links</th></thead><tbody>';
for (var i=0; i<myarray.length; i++) {
table += '<tr><td>'+ myarray[i][0] + '</td><td>'+myarray[i][1]+'</td></tr>';
};
var w = window.open("");
w.document.write(table);
}
make_table()