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...
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 :