Extract Synonyms From Google's Search Results

A bookmarklet to make a sorted list of all highlighted words and phrases (synonyms and closely related terms) from Google's search results.

SERP Synonyms
(Drag this button to your boormarks toolbar)

Source code

var phrases = Array.from(document.querySelectorAll('#search em'))
        .map(e => e.textContent.toLowerCase())
        .reduce((phrases, ph) => {
            phrases[ph] = (phrases[ph] || 0) + 1;
            return phrases;
        }, {});

var sorted = Object.entries(phrases).sort((a, b) => b[1] - a[1]);

var doc = window.open().document;
doc.write('<html><body><table border="1" cellspacing="0" cellpadding="4">');
sorted.forEach(e => {
    doc.write('<tr><td>' + e[0] + '</td><td>' + e[1] + '</td></tr>');
});
doc.write('</table></body></html>');
doc.close();

Notes

We count occurrences of phrases, not words. All phrases are converted to lower case.

Not working?

If in the future Google changes the SERP formatting it might break this script. In that case you will need to adjust the #search em selector in the first line.

Feedback

Leave a comment here: @ugnich