Hi, I am trying to write a script that downloads all uploaded files from a user’s portfolio page on an education platform. Each user account may have a different number of files to download. All the downloads can be located by a CSS element and I’ve tried to create a script that loops through the page so that it will download each file until it executes the final download.
However it just repeatedly downloads the first file, so my question is how do I get it move onto the next file?
I’m afraid I cannot share a public URL.
I’ve removed the code that loops through a csv file to retrieve the user-id as I got that working fine, it’s the downloads within the page I cannot get working,. Any help appreciated
{
“Name”: “05 Download Notes files-1”,
“CreationDate”: “2022-12-14”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://www.xxxxxxxxx.co.uk/portfolio/portfolio.aspx?UserID=xxxxxxxxx”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “loopSuccess”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “loopCount”,
“Description”: “”
},
{
“Command”: “while_v2”,
“Target”: “(${loopSuccess} > 0)”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “fieldset > a > div.attachment-download”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “if_v2”,
“Target”: “!${!statusOK}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “0”,
“Value”: “loopSuccess”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return Number(${loopCount}) + 1;”,
“Value”: “loopCount”,
“Description”: “”
},
{
“Command”: “echo”,
“Target”: “Loop count: ${loopCount}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
}
]
}