【问题标题】:Google Sheets ImportXML Split DefinitionsGoogle 表格 ImportXML 拆分定义
【发布时间】:2022-01-14 10:11:27
【问题描述】:

我为我的 ESL 学生制作了 Google Sheets Dictionary。我的问题是当工作表拉出多个定义时。我希望它只从站点中提取第一个/顶级定义。我知道有办法解决这个问题,但似乎无法解决。

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

【问题讨论】:

    标签: google-sheets xpath filter import google-sheets-formula


    【解决方案1】:

    尝试:

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


    更新:

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

    或者如果您只想尝试第一次:

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

    【讨论】:

    • 感谢您的回复。我添加了一个带有图像的“答案”来澄清我的问题。
    • @JamesOlson 回答已更新
    猜你喜欢
    • 2019-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-28
    • 2019-03-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多