Skip to content

Instantly share code, notes, and snippets.

@natzir
Last active December 19, 2022 11:40
Show Gist options
  • 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 Aug 19, 2019

Update 16.08.2019 by @fabio_seo

From class: sm-groups__data
var myCluster = document.getElementsByClassName('sm-groups__data');

To class: sm-group-item__content
var myCluster = document.getElementsByClassName('sm-group-item__content');

@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