问题描述
当前公式:IMPORTXML("https://int.soccerway.com/international/europe/uefa-champions-league/20192020/s17689/final-stages/","//td[@class='team team-a'] | //td[@class='team team-a strong']/a")
仅存在//td[@class='team team-a']
和//td[@class='team team-a strong']/a
值的//td[@class='team team-a']/@href
和//td[@class='team team-a strong']/a/@href
的导入值如何存在?
Winner Semi-final 2
和Winner Semi-final 1
不包含链接/ @ href
RB Leipzig
包含链接/ @ href -https://int.soccerway.com/teams/germany/rb-leipzig/13410/ PSG
包含链接/ @ href -https://int.soccerway.com/teams/france/paris-saint-germain-fc/886/
我想要的导入结果是这样:
RB莱比锡
PSG
解决方法
如果我对您的理解正确,这应该会有所帮助:
=IMPORTXML(url,"//h2[span='Semi-finals']/following-sibling::div[@class='content']//td[contains(@class,'team')]/a[@href]")
输出:
RB Leipzig
PSG