Skip to content

Instantly share code, notes, and snippets.

@david-forer
Forked from estevecastells/SERP Extractor
Created October 22, 2018 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-forer/618c336e3686ce7ea3c6e922c68cefc0 to your computer and use it in GitHub Desktop.
Save david-forer/618c336e3686ce7ea3c6e922c68cefc0 to your computer and use it in GitHub Desktop.
javascript:(function()%7Bfunction getParameterByName(e%2Ct)%7Be%3De.replace(%2F%5B%5C%5B%5D%2F%2C"%5C%5C%5B").replace(%2F%5B%5C%5D%5D%2F%2C"%5C%5C%5D")%3Bvar n%3Dnew RegExp("%5B%5C%5C%3F%26%5D"%2Be%2B"%3D(%5B%5E%26%23%5D*)")%2Cr%3Dn.exec(t%3D%3Dtrue%3Flocation.hash.replace("%23"%2C"%3F")%3Alocation.search)%3Bif(r%3D%3Dnull%26%26t%3D%3Dfalse)%7Breturn getParameterByName(e%2Ctrue)%7Delse%7Breturn r%3D%3Dnull%3F""%3AdecodeURIComponent(r%5B1%5D.replace(%2F%5C%2B%2Fg%2C" "))%7D%7Dstr%3D"<style type%3D%27text%2Fcss%27>body%7Bcolor%3A%23000%3Bbackground-color%3A%23fff%3Bmargin%3A0%3Bpadding%3A0%3Bfont-family%3Aarial%2Chelvetica%2Csans-serif%3Bfont-size%3A82%25%7D*%7Bfont-weight%3A400%3Bcolor%3A%23000%7Dh3%2Ch4%2Ch5%2Ch6%7Bmargin%3A0 0 15px%3Bpadding%3A0%7D%23rt%7Bfont-size%3A12px%3Bwidth%3A500px%7Dtable%2Ctd%2Cth%2Ctr%7Bfont-size%3A1em%3Boverflow%3Ahidden%3Btext-overflow%3Aellipsis%3Bword-wrap%3Abreak-word%7Dtextarea%7Bwidth%3A100%25%7Dth%7Bbackground-color%3A%23eee%3Bcolor%3A%23000%3Bfont-weight%3A700%7Dtd a%7Bwidth%3A446px%3Bdisplay%3Ablock%7D.id%7Bbackground%3A%23eee%3Bcolor%3A%23000%3Btext-align%3Acenter%7D.g%7Bfont-family%3Aarial%2Csans-serif%3Bcolor%3A%23000%3Bmargin%3A1em 0%3Bfont-size%3A122%25%7D.g h2%7Bfont-family%3Aarial%2Csans-serif%3Bmargin%3A0%7D.r%7Bdisplay%3Ainline%3Bfont-weight%3A400%3Bmargin%3A10%7D.j%7Bwidth%3A34em%7D.std%7Bfont-size%3A82%25%7D.a%7Bcolor%3Agreen%7D.fl%7Bcolor%3A%2377c%7D.bl%7Bdisplay%3Ainline%7Da%7Bcolor%3A%2300c%7Da%3Avisited%7Bcolor%3A%23551a8b%7Da%3Aactive%7Bcolor%3Ared%7D.twitter-share-button%7Bmargin-bottom%3A-5px%7Dp.b%7Bline-height%3A22px%3Btext-align%3Acenter%7D<%2Fstyle>%5Cn"%3Banchors%3Ddocument.getElementsByTagName("a")%3Bvar all%3D%5B%5D%3Bvar keyword%3DgetParameterByName("q"%2Cfalse)%3Bstr%2B%3D"<title>Google SERP Scraper Bookmarklet<%2Ftitle>"%3Bstr%2B%3D"<div style%3D%27width%3A 900px%3B margin%3A 0 auto%3B%27>"%3Bstr%2B%3D"<h1 style%3D%27margin%3A 1em 0em 0em 0em%3B text-align%3A center%3B%27>Google SERP Scraper Bookmarklet<%2Fh1>"%3Bstr%2B%3D"<h2 style%3D%27text-align%3A center%3B%27>Keyword - "%2Bkeyword%2B"<%2Fh2>"%3Bstr%2B%3D"<table width%3D%27100%25%27>"%3Bstr%2B%3D"<tr><th width%3D%275%25%27>Result<%2Fth><th width%3D%2750%25%27>Link<%2Fth><th width%3D%2745%25%27>Anchor Text<%2Fth><%2Ftr>%5Cn"%3Bvar tweetText%3D%27<p class%3D"b">If you use and like this%2C please <a href%3D"https%3A%2F%2Ftwitter.com%2Fshare" class%3D"twitter-share-button" data-count%3D"none" data-lang%3D"en" data-url%3D"http%3A%2F%2Fcognitiveseo.com%2Fblog%2F5714%2F69-amazing-seo-bookmarklets-to-supercharge-your-internet-marketing%2F" data-text%3D"%2F*Google SERP Scraper*%2F Bookmarklet %2B 68 Other Uber Amazing Bookmarklets">Tweet<%2Fa> about it and help us spread the word.<br %2F> Happy SCRAPing and thanks for sharing!<br %2F> Coded by <a href%3D"http%3A%2F%2Fcognitiveseo.com%2F" target%3D"_blank">cognitiveSEO<%2Fa>.<%2Fp>%27%3Bvar tweetScript%3D%27<script>!function(d%2Cs%2Cid)%7Bvar js%2Cfjs%3Dd.getElementsByTagName(s)%5B0%5D%3Bif(!d.getElementById(id))%7Bjs%3Dd.createElement(s)%3Bjs.id%3Did%3Bjs.src%3D"https%3A%2F%2Fplatform.twitter.com%2Fwidgets.js"%3Bfjs.parentNode.insertBefore(js%2Cfjs)%3B%7D%7D(document%2C"script"%2C"twitter-wjs")%3B<%2Fscript>%27%3Bvar k%3D0%3Bvar listing%3D""%3Bvar links%3D""%3Bvar anchorTexts%3D""%3Bvar linksAnchors%3D""%3Bfor(i%3D0%3Bi<anchors.length%3Bi%2B%2B)%7Bvar anchorText%3Danchors%5Bi%5D.textContent%3Bvar anchorLink%3Danchors%5Bi%5D.href%3Bvar linkAnchor%3D""%3Bif(anchorLink.match(%2F%5E((%3F!google%5C.%7Ccache%7C%5C.yahoo%5C.%7Cyoutube%5C.com%5C%2Fresults%7Cjavascript%3A%7B%7D%7Cjavascript%3Avoid%7Cjavascript%3A%5C%3B%7Capi%5C.technorati%5C.com%7Cbotw%5C.org%5C%2Fsearch%7Cdel%5C.icio%5C.us%5C%2Furl%5C%2Fcheck%7Cdigg%5C.com%5C%2Fsearch%7Csearch%5C.twitter%5C.com%5C%2Fsearch%7Csearch%5C.yahoo%5C.com%5C%2Fsearch%7Csiteanalytics%5C.compete%5C.com%7Ctools%5C.seobook%5C.com%5C%2Fgeneral%5C%2Fkeyword%5C%2Fsuggestions%7Cweb%5C.archive%5C.org%5C%2Fweb%5C%2F%7Cwhois%5C.domaintools%5C.com%7Cwww%5C.alexa%5C.com%5C%2Fdata%5C%2Fdetails%5C%2Fmain%7Cwww%5C.bloglines%5C.com%5C%2Fsearch%7Cwww%5C.majesticseo%5C.com%5C%2Fsearch%5C.php%7Cwww%5C.semrush%5C.com%5C%2Finfo%5C%2F%7Cwww%5C.semrush%5C.com%5C%2Fsearch%5C.php%7Cwww%5C.stumbleupon%5C.com%5C%2Furl%7Cwikipedia.org%5C%2Fwiki%5C%2FSpecial%3ASearch).)*%24%2Fi)%26%26anchorLink!%3D""%26%26all.indexOf(anchorLink)%3D%3D-1%26%26anchorText!%3D""%26%26anchors%5Bi%5D.className!%3D"gb_b")%7Ball.push(anchorLink)%3Blisting%2B%3DanchorLink%2B"%5Cn"%3BanchorTexts%2B%3DanchorText%2B"%5Cn"%3BlinkAnchor%3DanchorLink.replace("%2C"%2C"%252C")%2B"%2C%09"%2BanchorText.replace("%2C"%2C"")%3BlinksAnchors%2B%3DlinkAnchor%2B"%5Cn"%3Bk%3Dk%2B1%3Bif(anchorText%3D%3D%3Dundefined)anchorText%3Danchors%5Bi%5D.innerText%3Bstr%2B%3D"<tr>"%3Bstr%2B%3D"<td class%3D%27id%27>"%2Bk%2B"<%2Ftd>"%3Bstr%2B%3D"<td><a href%3D"%2Banchors%5Bi%5D.href%2B" target%3D%27_blank%27>"%2Banchors%5Bi%5D.href%2B"<%2Fa><%2Ftd>"%3Bstr%2B%3D"<td>"%2BanchorText%2B"<%2Ftd>"%3Bstr%2B%3D"<%2Ftr>%5Cn"%7D%7Dstr%2B%3D"<%2Ftable><br%2F><br%2F><table width%3D%27100%25%27><tr><td width%3D%2755%25%27><h2>Links<%2Fh2><textarea rows%3D10 style%3D%27width%3A97%25%27 readonly>"%3Bstr%2B%3Dlisting%3Bstr%2B%3D"<%2Ftextarea><%2Ftd><td width%3D%2745%25%27><h2>Anchors<%2Fh2><textarea rows%3D10 readonly>"%3Bstr%2B%3DanchorTexts%3Bstr%2B%3D"<%2Ftextarea><%2Ftd><%2Ftr><%2Ftable><br%2F><br%2F><h2>All Data - CSV<%2Fh2><textarea rows%3D10 readonly>"%3Bstr%2B%3D"Links%2C Anchors%5Cn"%3Bstr%2B%3DlinksAnchors%3Bstr%2B%3D"<%2Ftextarea><br %2F> <br %2F>"%3Bstr%2B%3DtweetText%3Bstr%2B%3DtweetScript%3Bstr%2B%3D"<br %2F><%2Fdiv> <br %2F>"%3Bwith(window.open())%7Bdocument.write(str)%3Bdocument.close()%7D%7D)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment