Home > Mobile >  Using IMPORTXML to just retrieve the closing date and nothing else
Using IMPORTXML to just retrieve the closing date and nothing else

Time:05-04

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? enter image description here

or just a date:

=REGEXEXTRACT(QUERY(FLATTEN(IMPORTXML(A1, "//*[@id]")),
 "where Col1 starts with 'Closing date'"), "(\d .*).")

CodePudding user response:

Try

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

or

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

enter image description here

  • Related