Open Browser Developer Console, put and run it: var x = document.querySelectorAll("a"); var myarray = [] for (var i=0; i'+myarray[i][1]+''; }; var w = window.open(""); w.document.write(table); } make_table()