The Fixer 1 Posted November 8, 2014 Report Share Posted November 8, 2014 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()dividerui 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", "")} Quote Link to post Share on other sites
a2mateit 395 Posted November 8, 2014 Report Share Posted November 8, 2014 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 Quote Link to post Share on other sites
The Fixer 1 Posted November 8, 2014 Author Report Share Posted November 8, 2014 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, 1 Quote Link to post Share on other sites
arunner26 51 Posted November 8, 2014 Report Share Posted November 8, 2014 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}") Quote Link to post Share on other sites
a2mateit 395 Posted November 9, 2014 Report Share Posted November 9, 2014 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. Quote Link to post Share on other sites
The Fixer 1 Posted November 9, 2014 Author Report Share Posted November 9, 2014 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, Quote Link to post Share on other sites
arunner26 51 Posted November 9, 2014 Report Share Posted November 9, 2014 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. Quote Link to post Share on other sites
The Fixer 1 Posted November 13, 2014 Author Report Share Posted November 13, 2014 arunner26, thanks for your post. I haven't tried it yet but I just wanted to say thanks. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.