I'm having problems with a javascript bookmarklet to scrape data off a webpage. The code runs as planned in Opera, but fails in FireFox.
In all it's one lined glory
Formatted for readability
Any help, even a link to a relevant page, or topics to search for, would be greatly appreciated.
In all it's one lined glory
Code:
javascript:temp=prompt("Please enter Building Coordinates\nExample: 0,0");output=temp+",";size=document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[6].cells.length;numcommods=(size-10)/7;cel=6;for (m=1; m<=numcommods; m++){for (n=1;n<=5;n++){output += document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[6].cells[cel].innerHTML+",";cel++;};output+=document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[4].cells[(m*5)+1].innerHTML+",";cel+=2;};location.href="http://71.205.48.105/pardus/bookmarklet.php?data="+encodeURIComponent(output);
Code:
javascript:temp=prompt("Please enter Building Coordinates\nExample: 0,0");
output=temp+",";
size=document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[6].cells.length;
numcommods=(size-10)/7;
cel=6;
for (m=1; m<=numcommods; m++) {
for (n=1;n<=5;n++) {
output += document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[6].cells[cel].innerHTML+",";
cel++;};
output+=document.getElementsByName("main")[0].contentDocument.getElementsByTagName("table")[4].cells[(m*5)+1].innerHTML+",";
cel+=2;};
location.href="http://71.205.48.105/pardus/bookmarklet.php?data="+encodeURIComponent(output);
Comment