Using IMPORTXML to just retrieve the closing date and nothing else

I need to scrape just the closing date on a website onto google sheets.

currently using =IMPORTXML(A1,"//*[@id]") but it scrapes all the data on the site.

I need just the closing date right at the bottom of this page, is this possible?

2 answers

  • answered 2022-05-04 10:20 player0


    =QUERY(FLATTEN(IMPORTXML(A1, "//*[@id]")), 
     "where lower(Col1) starts with 'closing date'")

    enter image description here

    or just a date:

     "where lower(Col1) starts with 'closing date'"), "(\d+.*).")

    enter image description here

  • answered 2022-05-04 11:39 Mike Steelson


    =IMPORTXML(A1, "//p/span/span/strong/span")


    =REGEXEXTRACT(IMPORTXML(A1, "//p/span/span/strong/span"),"Closing date (.*)\.")

    enter image description here

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum