Data scraping gives different date values when running compared to debugging

I am trying to scrape a table. The table contains lots of information, including date and time information. I wish to scrape the table and discard every row except for the first, which I use to perform some checks. One of the checks on the first row confirms wether the value in the ‘date’ column matches today’s date.

When stepping through the workflow in debug mode, the scraped date is in the exact same format as in the table on the website. No problems there.

When running the workflow however, the extracted date has some extra junk prepended onto it.

My question is how do I get the correct date string I get when debugging, when running normally? I have included a screenshot of the output when running normally. The output I want should say “15/08/2021 16:19:50”

Date extracted when not running in debug mode.
date when running

Hi @xncxx

Try convert todatetime(Strvariable).To string("DDMMYYYY hhmmss)


Hi @AshwinS2, thanks for your reply!

I have tried this, but doing so throws a format error. It says that the string is not recognized as a valid DateTime. I believe this is because the string has “2021085161950”, and a lot of spaces and a new line before the “15/08/2021 16:19:50” part.

Use trim and give format as dd/MM/yyyy hh:mm:ss


Hi @AshwinS2.

I would use Trim, but I have a garbage string at the start. I have included a screenshot of the date and time I extract when running the workflow normally i.e. not in debug mode.

date when running

As I’ve mentioned, when I run the workflow in debug mode, the extracted date and time is in the correct format, but when not running in debug mode, the output is as shown above. Have you any idea why this could be happening?

I’ve managed to “fix it” by adding a delay activity before the ‘Extract Structured Data’ activity. The delay is for 4 seconds. Running the workflow normally (not in debug mode) now produces the correct extracted date and time format.

My best as to why it wasn’t working before is that the Data Scrape was happening as soon as the table was loaded, and maybe not allowing enough time for data formatting to take place? Very strange!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.