Jump to content
UBot Underground

Help! How to download files on a list to a folder!


Recommended Posts

I am building a bot and it creates a list of the complete url of each file meeting my requirements. Now, how do I have Ubot visit each url and download the file to a specific folder on my desktop? I can save the list to a file but how do I take the url's on the list, execute each one and save it to a folder?

 

The site url has been changed for this posting but here is the code:

 

navigate("https://www.rubaduddub.asp""Wait")
rockon()
divider
ui text box("Date"#date)
define rockon {
    type text(<name="ReleasedDate">#date"Standard")
    click(<name="submit12">"Left Click""No")
}
add list to list(%urj$scrape attribute(<href=w"/InOpHistoric/*.pdf">"fullhref"), "Delete""Global")
loop($list total(%urj)) {
    navigate($next list item(%urj), "Wait")
    wait for browser event("Everything Loaded""")
}

Link to post
Share on other sites

You should be able to do it with the download file command.

It should look a little something like this:

download file($next list item(%urj), "{$special folder("Application")}/Your Folder Here/file name here.txt")

HTH,

Justin

Link to post
Share on other sites

Thank you a2mateit. One more question. Since each file name is different, how do I get the download file command to save the name of the file under the name of each individual file instead of using one file name as per your suggestion above?

 

Thanks,

  • Like 1
Link to post
Share on other sites

Thank you a2mateit. One more question. Since each file name is different, how do I get the download file command to save the name of the file under the name of each individual file instead of using one file name as per your suggestion above?

 

Thanks,

 

set(#filename, "File123.txt", "Global")

download file($next list item(%urj), "{$special folder("Application")}/Your Folder Here/{#filename}")

Link to post
Share on other sites

set(#filename, "File123.txt", "Global")

download file($next list item(%urj), "{$special folder("Application")}/Your Folder Here/{#filename}")

 

Yep.

 

You can set the file name to whatever you want before each download.

Link to post
Share on other sites

Thank you arunner26 and a2mateit for your response. However, I'm still missing that aha moment. the set example above says File123.txt. However, each file has a different name. Wouldn't using the above code create one file named File123.txt and then the next file downloaded would overwrite the previous file downloaded since only one File123.txt command exists? I hope I'm making sense. Lets see it another way:

 

1. The file name changes per file downloaded.

2. How can I download each file with its own unique name to be saved in the folder?

3. How can I get Ubot to give each file its own name as appeared on the website , such as *.pdf?

 

Thanks,

Link to post
Share on other sites
The Fixer,

I think from what you have posted here that you are going to get a list of files to download by scraping a page with the file names and putting them in a UBOT list.

You will then need to write a UBOT loop command and the set command I wrote about above will be in the loop but instead of using the literal "file123.txt" it will use an entry from that list you scraped.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...