Digital Farmer
Digital Farmer

Reputation: 2107

Filter dates imported from a site

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/

enter image description here

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

Upvotes: 1

Views: 48

Answers (1)

Tanaike
Tanaike

Reputation: 201388

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:

enter image description here

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

Upvotes: 1

Related Questions