Google Sheets ImportXML Split Definitions

Viewed 88

I made a Google Sheets Dictionary for my ESL students. My issue is when the sheet is pulling multiple definitions. I would like it to only pull the first/top definition from the site. I know there is a way to fix this but can't seem to figure it out.

=IFERROR(INDEX(SPLIT(CONCATENATE(IMPORTXML("https://www.learnersdictionary.com/definition/"&A4,"//span[@class='def_text']")),":",FALSE,TRUE),1,1))
1 Answers

try:

=IMPORTXML("https://www.learnersdictionary.com/definition/"&A4,
 "//ul[@class='o_list verdana_font']")

enter image description here


update:

=IMPORTXML("https://www.learnersdictionary.com/definition/"&A4,
 "//span[@class='def_text']")

enter image description here

or if you want just first one try:

=INDEX(IMPORTXML("https://www.learnersdictionary.com/definition/"&A4,
 "//span[@class='def_text']"), 1, 1)
Related