ImportXML "//tr/td[@class='X']" 只有在 "//tr" 里面还有 "//tr/td[@class='Y']"
ImportXML "//tr/td[@class='X']" only when inside "//tr" there is also "//tr/td[@class='Y']"
示例:我要制作 importXML(Google 表格功能)的页面具有以下结构(状态和分数 → Td Class):
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time status"
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time score"
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time status"
存在于td class = "date no-repetition"但后面没有td class = "score-time status"的数据不是我需要的,我想知道是否有任何方法可以过滤导入 "home" 仅当内部 "TR" 存在 "date no-repetition" 和 "score-time status" classes... 该站点没有固定数据位置,所以我无法通过选择 date no-repetition[1] date no-repetition[3] date no-repetition[5] 来定义要导入的"home's"。
=ARRAYFORMULA(TRANSPOSE(SPLIT(CONCATENATE("♦"&TEXT(REGEXEXTRACT(
IMPORTXML(A4, A3), "\d+/\d+/\d+"), "dd/mm/yyyy")&"♦"&IMPORTXML(A4, A3)), "♦")))
或简单:
=ARRAYFORMULA({TEXT(REGEXEXTRACT(
IMPORTXML(A4, A3), "\d+/\d+/\d+"), "dd/mm/yy"),IMPORTXML(A4, A3)})
示例:我要制作 importXML(Google 表格功能)的页面具有以下结构(状态和分数 → Td Class):
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time status"
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time score"
<tr class=class="odd expanded match no-date-repetition"
<td class="date no-repetition"
<td class="score-time status"
存在于td class = "date no-repetition"但后面没有td class = "score-time status"的数据不是我需要的,我想知道是否有任何方法可以过滤导入 "home" 仅当内部 "TR" 存在 "date no-repetition" 和 "score-time status" classes... 该站点没有固定数据位置,所以我无法通过选择 date no-repetition[1] date no-repetition[3] date no-repetition[5] 来定义要导入的"home's"。
=ARRAYFORMULA(TRANSPOSE(SPLIT(CONCATENATE("♦"&TEXT(REGEXEXTRACT(
IMPORTXML(A4, A3), "\d+/\d+/\d+"), "dd/mm/yyyy")&"♦"&IMPORTXML(A4, A3)), "♦")))
或简单:
=ARRAYFORMULA({TEXT(REGEXEXTRACT(
IMPORTXML(A4, A3), "\d+/\d+/\d+"), "dd/mm/yy"),IMPORTXML(A4, A3)})