Skip to content

Instantly share code, notes, and snippets.

@natzir
Last active December 19, 2022 11:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natzir/874e326d37b90e3e7964869e8f39c307 to your computer and use it in GitHub Desktop.
Save natzir/874e326d37b90e3e7964869e8f39c307 to your computer and use it in GitHub Desktop.
Export SEMRush Keyword Clusters
javascript:(function(){output="<html><head><title>Semrush Clusters Extractor</title></head><body><button onclick=\"tableToExcel('semrushTable', 'SEMRush Clusters')\">Export SEMRush Clusters</button><table%20id=\"semrushTable\"><tr><th>Keyword</th><th>Volume</th></tr>";var myCluster = document.getElementsByClassName('sm-groups-item-layout');for(var i = 1; i < myCluster.length; i++){var keyword = myCluster[i].innerText.replace(/,/g,'');output=output + "<tr><td>" + keyword.replace(/\s/g,'</td><td>') +"</tr></td>";};output+="</table>";with(window.open()){document.write(output);document.body.appendChild(document.createElement('script')).src='https://bl.ocks.org/insin/raw/1031969/tableToExcel.js';document.close();}})();
@natzir
Copy link
Author

natzir commented Dec 16, 2022

Update 16.12.22

From class: sm-group-item__content
To class: sm-groups-item-layout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment