csvSave with no effect

I’m having an issue with csvSave which is that after a random number of loops (with or for) it simply stops saving the data to the file with no error whatsoever.
This is not limited to one macro, I’ve tested this multiple macros and even on different computers.
The csv file keeps showing the file change datatime property as updated, but no further data is being added to the file.
This happens randomly, it can happen after a few loops, or after many, or even does not get to happen sometimes.
I realized in the meanwhile that I was not having this issue before August and this may be related to the latest XModule update in early August…

Any idea on what can be the problem and how to fix this?

Windows 10 64-bits, Chrome Version 75.0.3770.100 32-bits, UI.Vision RPA 5.8.8


{
  "Name": "HTTP1",
  "CreationDate": "2020-8-24",
  "Commands": [
    {
      "Command": "store",
      "Target": "82",
      "Value": "WWW"
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore"
    },
    {
      "Command": "store",
      "Target": "fast",
      "Value": "!replayspeed"
    },
    {
      "Command": "store",
      "Target": "5",
      "Value": "!timeout_wait"
    },
    {
      "Command": "store",
      "Target": "20",
      "Value": "!TIMEOUT_PAGELOAD"
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "LinStart"
    },
    {
      "Command": "comment",
      "Target": "store // 50000",
      "Value": "LinEnd"
    },
    {
      "Command": "store",
      "Target": "${LinStart}",
      "Value": "Lin"
    },
    {
      "Command": "csvRead",
      "Target": "HTTPin.csv",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!csvReadMaxRow}",
      "Value": "LinEnd"
    },
    {
      "Command": "while_v2",
      "Target": "Number(${Lin})<=Number(${LinEnd})",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${Lin}",
      "Value": "!csvReadLineNumber"
    },
    {
      "Command": "csvRead",
      "Target": "HTTPin.csv",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!COL1}",
      "Value": "P_ID"
    },
    {
      "Command": "store",
      "Target": "${!COL2} ${!COL3}",
      "Value": "T_dt"
    },
    {
      "Command": "comment",
      "Target": "executeScript_Sandbox // var d=new Date(); return (d.getDate()<10?'0':'')+d.getDate()+'-'+(((d.getMonth()+1)<10)?'0':'')+((d.getMonth()+1))+'-'+d.getFullYear()+' '+(d.getHours()<10?'0':'')+d.getHours()+':'+(d.getMinutes()<10?'0':'')+((d.getMinutes()+1));",
      "Value": "C_dt"
    },
    {
      "Command": "comment",
      "Target": "executeScript_Sandbox // var d=new Date(); var c=new String(); return c=${C_dt}.slice(3,6)+${C_dt}.slice(0,3)+${C_dt}.slice(6,20); return d=Date(c); return d;",
      "Value": "C_dt1"
    },
    {
      "Command": "comment",
      "Target": "executeScript_Sandbox // var d=new Date(${C_dt1}); return d.getTime();",
      "Value": "C_dt2"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "var d=Date.now(); return d;",
      "Value": "C_dt2"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "var d=new Date(); var t=new String(); return t=${T_dt}.slice(3,6)+${T_dt}.slice(0,3)+${T_dt}.slice(6,20); return d=Date(t); return d;",
      "Value": "T_dt1"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "var d=new Date(${T_dt1}); return d.getTime();",
      "Value": "T_dt2"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${T_dt2} > ${C_dt2}",
      "Value": "Tst_dt"
    },
    {
      "Command": "if_v2",
      "Target": "${Tst_dt}",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${T_dt} ${T_dt1} ${T_dt2} ${C_dt2}",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${T_dt} ${T_dt1} ${T_dt2} ${C_dt2}",
      "Value": "!csvLine"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${Lin})+99999;",
      "Value": "Lin"
    },
    {
      "Command": "gotoLabel",
      "Target": "EndLoop",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://www${WWW}.hattrick.org/Club/Players/Player.aspx?playerId=${P_ID}",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${P_ID}",
      "Value": "!csvLine"
    },
    {
      "Command": "waitForElementVisible",
      "Target": "id=transferHistory",
      "Value": ""
    },
    {
      "Command": "storeText",
      "Target": "id=transferHistory",
      "Value": "TransfTxt"
    },
    {
      "Command": "if_v2",
      "Target": "${TransfTxt}.length<20",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!COL2}",
      "Value": "!csvLine"
    },
    {
      "Command": "gotoLabel",
      "Target": "EndLoop",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${TransfTxt}.replace((/  |\\r\\n|\\n|\\r/gm),\"\");",
      "Value": "TransfTxt"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${TransfTxt}.search(${!COL2}));",
      "Value": "StrStart"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${TransfTxt}.indexOf(\"(R)\",${StrStart}));",
      "Value": "StrEnd"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${TransfTxt}.slice(${StrStart},${StrEnd});",
      "Value": "TransfTxt"
    },
    {
      "Command": "if_v2",
      "Target": "${TransfTxt}.length<20",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!COL2}",
      "Value": "!csvLine"
    },
    {
      "Command": "gotoLabel",
      "Target": "EndLoop",
      "Value": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${TransfTxt}",
      "Value": "!csvLine"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"mainBody\"]/p/a[1]",
      "Value": "!csvLine"
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"mainBody\"]/p/a[2]",
      "Value": "!csvLine"
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"mainBody\"]/p/a[3]",
      "Value": "!csvLine"
    },
    {
      "Command": "label",
      "Target": "EndLoop",
      "Value": ""
    },
    {
      "Command": "csvSave",
      "Target": "HTTPout",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${Lin})+3;",
      "Value": "Lin"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://www.hattrick.org/pt/",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=ctl00_CPContent_ucLogin_txtUserName",
      "Value": "sandrosantos"
    },
    {
      "Command": "type",
      "Target": "id=ctl00_CPContent_ucLogin_txtPassword",
      "Value": "iguess"
    },
    {
      "Command": "click",
      "Target": "id=ctl00_CPContent_ucLogin_butLogin",
      "Value": ""
    },
    {
      "Command": "run",
      "Target": "HTT",
      "Value": ""
    }
  ]
}

What do you have to do with this macro code, it seems too long, what job do you have to do and why are you using such a long code to do a job?

I use csvsave and working well but i optimize macro code.

Thanks, the code can be optimized for sure, but it still requires many steps.
With this code I do web scrapping based on a csvRead list and it is fully working with no errors, the only difference is that the csvSave is, for some unknown reason, not saving the data to the file.
I realize now that I was not having this issue before August and this may be related to the XModule update in early August…

I have made many macros for scraping and they work great and save data in the csv without any problem (for search engines and social media) but your code is very long and you can not understand.

Doing a scraping automation is simple, it’s a few lines of code, with storetest you save data and with csvsave you save them in csv and with a loop you run it the times you need.

I can’t understand your code is full in my opinion of unhelpful parts that confuse.

try to extract only the scraping part and evaluate whether that works.

Well, after quite a while of experiment and even without changing the code, I got improvements simply by selecting no logs registry.
With this change I don’t have any problems with csvSave anymore, at least so far.
Although the problem persists, at least there seems to be this work around, so if eventually anyone else has a similar issue, hope this helps.