Get Synonyms of a Word from Thesaurus Using Google Sheets Importxml Function

I am trying to make a dictionary that includes one synonym for each word on Google Sheets. I wish that I can get only first synonym on the Thesaurus search result page, by copying XPath and pasting it to the importxml function. Could anybody help me getting the entire function that I can apply to all of my words? (hundreds of words so I need automation).

1 Answer

You can use something like this (first we concat to generate the url, then we pass the XPath expression :

=IMPORTXML(""&B2;"(//h2)[1]/following::li[1]//text()")

Output :

EDIT : To get 3 synonyms in one cell, use :

=TEXTJOIN(";";VRAI;IMPORTXML(""&B2;"(//h2)[1]/following::li[position()<4]//text()"))

Output :

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest