I designed a macro that should first pick artist name from a CSV file search it and then scrap and paste a date into same CSV file.
The first step picking artist’s name is working well, but UI VIsion is unable to save date into CSV file.
Actually, it saves and when it saves new data for another artist it erase first written date.
is there any stable way so that I can save data into a CSV file.
{
"Name": "spotify",
"CreationDate": "2023-6-26",
"Commands": [
{
"Command": "csvReadArray",
"Target": "Artist Release Radar Alerts.csv",
"Value": "csv",
"Description": ""
},
{
"Command": "times",
"Target": "${!CsvReadMaxRow}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${!times};",
"Value": "i",
"Description": ""
},
{
"Command": "open",
"Target": "https://open.spotify.com/search",
"Value": "",
"Description": ""
},
{
"Command": "type",
"Target": "xpath=//*[@data-testid=\"search-input\"]",
"Value": "",
"Targets": [
"xpath=//*[@id=\"main\"]/div/div[2]/div/header/div[3]/div/div/form/input",
"xpath=//input[@value='']",
"xpath=//input",
"css=#main > div > div.ZQftYELq0aOsg6tPbVbV > div.PHgyArRLVFknlaOm31ID > header > div.rovbQsmAS_mwvpKHaVhQ > div > div > form > input"
],
"Description": ""
},
{
"Command": "sendKeys",
"Target": "xpath=//*[@data-testid=\"search-input\"]",
"Value": "${csv[${i}][0]}",
"Targets": [
"xpath=//*[@id=\"main\"]/div/div[2]/div/header/div[3]/div/div/form/input",
"xpath=//input[@value='']",
"xpath=//input",
"css=#main > div > div.ZQftYELq0aOsg6tPbVbV > div.PHgyArRLVFknlaOm31ID > header > div.rovbQsmAS_mwvpKHaVhQ > div > div > form > input"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@data-testid=\"herocard-click-handler\"]",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "xpath=(//*[@data-testid=\"card-click-handler\"])[1]",
"Value": "",
"Description": ""
},
{
"Command": "pause",
"Target": "1000",
"Value": "",
"Description": ""
},
{
"Command": "storeText",
"Target": "xpath=(//*[@class=\"contentSpacing\"]//p[@data-encore-id=\"type\"])[1]",
"Value": "a",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "var str = ${a};\nvar str = str.replace(\",\", \"-\");\nvar str = str.replace(\",\", \"-\");\nreturn str;",
"Value": "a",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "var g=${csv};\ng[${i}][1]=${a};\nreturn g;",
"Value": "csv1",
"Description": ""
},
{
"Command": "csvSaveArray",
"Target": "csv1",
"Value": "Artist Release Radar Alerts.csv",
"Description": ""
},
{
"Command": "end",
"Target": "",
"Value": "",
"Description": ""
}
]
}