nemsis
Junior Member
- Sep 27, 2009
- 197
- 294
Hi,
I was in need of a quick solution to extract google serp urls without having to run a scraper so I wrote this little script. I decided to share it because last time I shared a js code people loved it
Step 1: Go to any google serp
Step 2: Paste this javascript code in your browser location bar
I hope this will be useful for some of you.
Step 3: Enjoy and press the thanks button
I was in need of a quick solution to extract google serp urls without having to run a scraper so I wrote this little script. I decided to share it because last time I shared a js code people loved it
Step 1: Go to any google serp
Code:
Example: http://www.google.com/search?q=example
Step 2: Paste this javascript code in your browser location bar
Code:
javascript: /* nemsis 4 bhw */ function g_rs() { var serpl = []; for (var i=0; i < document.links.length; i++) {if (document.links[i].getAttribute("class")=="l"){serpl[serpl.length] = document.links[i];}}var gstr = ""; for (var i=0; i<serpl.length; i++) {gstr += serpl[i] + "<br />";} gstr += "<p>Number of URLs: "+serpl.length+"</p>"; gstr += unescape("%3C%70%3E%3C%73%6D%61%6C%6C%3E%6E%65%6D%73%69%73%20%34%20%3C%61%20%68%72%65%66%3D%27%68%74%74%70%3A%2F%2F%77%77%77%2E%62%6C%61%63%6B%68%61%74%77%6F%72%6C%64%2E%63%6F%6D%2F%62%6C%61%63%6B%68%61%74%2D%73%65%6F%2F%69%6E%64%65%78%2E%70%68%70%3F%72%65%66%65%72%72%65%72%69%64%3D%36%39%30%38%33%27%3E%62%68%77%3C%2F%61%3E%3C%2F%73%6D%61%6C%6C%3E%3C%2F%70%3E"); /* nemsis 4 bhw */ document.write(gstr); } g_rs();
I hope this will be useful for some of you.
Step 3: Enjoy and press the thanks button