Search code examples
dategoogle-sheetsimportgoogle-sheets-formulaflatten

Importxml changes to data which is scraped


I had alot of help on here on making this sheet which scrapes the end date from my clients URLs so we can keep track of when the roles are closing.

The client has now changed the URL so that on the end of the closing date is also the closing time, for example 23:55 hours. Is there a way to adjust the Importxml formula on this sheet so that it only scrapes the specific closing date and ignores anything after it?

Thank you


Solution

  • try:

    =TO_DATE(REGEXREPLACE(REGEXEXTRACT(QUERY(QUERY(FLATTEN(
     IMPORTXML(B2, "//*")),
     "where lower(Col1) starts with 'closing date'"),,9^9), 
     "(\d+.. .{3,9} \d{4})"), "rd|st|th", )*1)
    

    enter image description here