【问题标题】:Google sheet multible ImportXMLfails谷歌工作表多个导入 XML 失败
【发布时间】:2020-12-26 14:00:52
【问题描述】:

我有一个谷歌表,我想在其中刮一些 股票价格,在给定的示例中,有 5 个股票价格,所有 5 个 importXML 查询都有效,只是不能同时工作,那些不工作的只给一个“-”回,但实际上并没有一个系统没有工作,在它们之间实际上都工作 5。我想这是因为 Google Sheet 不能同时处理所有 5 个查询。

importXML 如下所示:

=IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16712858-goodfood-market";"//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41 -1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")

=IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16100472-studsvik";"//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")

=IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16874165-kahoot";"//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")

=IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16886100-flexion-mobile";"//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41 -1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")

=IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16290321-kambi-group";"//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41 -1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")

有人对此有解决方案吗?

【问题讨论】:

    标签: google-sheets google-sheets-formula


    【解决方案1】:

    尝试:

    =INDEX({
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16712858-goodfood-market";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16100472-studsvik";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\ 
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16874165-kahoot";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16886100-flexion-mobile";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\ 
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16290321-kambi-group";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")})
    

    或者只是一行:

    =INDEX({
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16712858-goodfood-market";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16100472-studsvik";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\ 
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16874165-kahoot";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16886100-flexion-mobile";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")\ 
     IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16290321-kambi-group";
     "//span[@class='Typography__Span-sc-10mju41-0 efGqYn Typography__StyledTypography-sc-10mju41-1 dKBtpx StatsBox__StyledPriceText-sc-1dqlo5q-2 emzYuD']")}; 1)
    

    【讨论】:

    • 感谢您的发送,但是是否有逻辑解释为什么单元格 D1 中没有值,它与其他单元格完全相似,如果您进入那里它有一个值:nordnet.dk/markedet/aktiekurser/16886100-flexion-mobile
    • 你可以试试:=INDEX(IMPORTXML("https://www.nordnet.dk/markedet/aktiekurser/16886100-flexion-mobile"; "//div[@class='Box__StyledDiv-sc-1bfv3i9-0 kZjEAL']"); 1) - i.stack.imgur.com/EGYUn.png
    • 谢谢,我没有让它工作,但后来我在另一个网站上尝试了,然后它工作了:-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多