筛选从网站导入的日期 [英] Filter dates imported from a site

查看:61
本文介绍了筛选从网站导入的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从此列表中收集尚未开始的每个游戏的日期,小时和链接:

问题在于导入的日期数大于小时数和链接数,因为它导入的是已经结束的游戏的日期.

有什么方法可以过滤日期,以便只有尚未开始的游戏才能出现?

我在使用的公式和电子表格的链接下放置:

  = ARRAYFORMULA({IMPORTXML(A1,"//td [@ class ='date no-repetition']/span"),IMPORTXML(A1,"//td [@ class ='score-time status']/a/span"),"https://"& IMPORTXML(A1,"//td [@ class ='score-time status']/a/@ href")}) 

如果我误解了您的问题,而这不是您想要的结果,我深表歉意.

I am trying to collect the date, hour and link of each of the games that have not yet started from this list:
https://int.soccerway.com/international/europe/uefa-champions-league/20192020/group-stage/r54142/

The problem is that the number of dates being imported is larger than the number of hours and links, because it is importing the dates of games that have already ended.

Is there any way to filter the dates so that only the games that haven't started yet come?

I leave below the formula I'm using and the link of my spreadsheet:

=ARRAYFORMULA(
              {
               IMPORTXML(A1,"//td[@class='date no-repetition']/span"),
               IMPORTXML(A1,"//td[@class='score-time status']/a/span"),
               "https://"&IMPORTXML(A1,"//td[@class='score-time status']/a/@href")
              }
             )

https://docs.google.com/spreadsheets/d/1-tfb7TTb-sEDIp0T8YfIIYwjBJLUgruckdgQN3oTEM8/edit?usp=sharing

解决方案

How about this modification? Please think of this as just one of several possible answers.

Modified xpath:

For IMPORTXML(A1,"//td[@class='date no-repetition' and ../td[@class='score-time status']]/span"), how about the following modification?

From:

//td[@class='date no-repetition']/span

To:

//td[@class='date no-repetition' and ../td[@class='score-time status']]/span

Modified formula:

=ARRAYFORMULA(
              {
               IMPORTXML(A1,"//td[@class='date no-repetition' and ../td[@class='score-time status']]/span"),
               IMPORTXML(A1,"//td[@class='score-time status']/a/span"),
               "https://"&IMPORTXML(A1,"//td[@class='score-time status']/a/@href")
              }
             )

Result:

If I misunderstood your question and this was not the result you want, I apologize.

这篇关于筛选从网站导入的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆