ZonkDonkey 0 Posted January 14, 2016 Report Share Posted January 14, 2016 I'm having an issue trying to save a file. For instance, the bot will: 1. Click the "Download" button2. Windows dialog pop up This loads the original file name but how do I save it to a specific folder? When I try this tutorial: http://wiki.ubotstudio.com/wiki/Save_Downloaded_FileI am unable to use the original file name. Any help is appreciated. Quote Link to post Share on other sites
Brutal 164 Posted January 14, 2016 Report Share Posted January 14, 2016 ZD, pass your code snippet into your post and i'm sure several of us will be able to pop in and help you get on the right track. Quote Link to post Share on other sites
ZonkDonkey 0 Posted January 14, 2016 Author Report Share Posted January 14, 2016 Thanks Brutal, There isn't much to the code as of now, just a button click: click(<image="___IMAGE___4___IMAGE___">,"Left Click","No") A "Save As" box comes up and I just need to know how to save it into a specific folder with its original filename. Quote Link to post Share on other sites
Brutal 164 Posted January 14, 2016 Report Share Posted January 14, 2016 ok, i get you...... if you dont want to post a link to your target download page, maybe you know of another page that has a similar button.... just something that will help me to see waht you see so that I can help you find a solution. Quote Link to post Share on other sites
ZonkDonkey 0 Posted January 14, 2016 Author Report Share Posted January 14, 2016 Oh, sorry about that. The target download page is secured on Amazon. Here is a screenshot if that helps: http://screencast.com/t/654R4LKk Quote Link to post Share on other sites
Brutal 164 Posted January 14, 2016 Report Share Posted January 14, 2016 ok, i have no access to anything similar. So lets start from the top. Using 'image' for click has always been 'iffy' from my experience so I tend to avoid it at all costs. Next, if you are clicking the button and it is causing the windows save file dialog to open, then you have to physically interact with that screen or use ubot windows commands to interact with it. I'm not familiar with the standard edition of ubot, does it have the 'record' option in it? That will likely be your fastest fix if you have it. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 14, 2016 Report Share Posted January 14, 2016 Here is how you can do it, you will need the file management plugin Here is an example using this page: http://ubotsandbox.com/download-testing.php set(#download_url,$scrape attribute(<id="MyZipfile">,"href"),"Global") download file(#download_url,"{$special folder("Desktop")}\\{$plugin function("File Management.dll", "$file name", #download_url)}") 1 Quote Link to post Share on other sites
ZonkDonkey 0 Posted January 14, 2016 Author Report Share Posted January 14, 2016 Okay, so I have a few things... Thought it would be easier to shoot a quick video to show you what I am doing: http://screencast.com/t/VkBPRQFflz Here is how you can do it, you will need the file management plugin Here is an example using this page: http://ubotsandbox.com/download-testing.php set(#download_url,$scrape attribute(<id="MyZipfile">,"href"),"Global") download file(#download_url,"{$special folder("Desktop")}\\{$plugin function("File Management.dll", "$file name", #download_url)}") Thanks for this, I will test it out! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 14, 2016 Report Share Posted January 14, 2016 You will have to use element offset in order to get the first of something and set the offset to be 0 which will only get the first one that is how you can select only the first button. Since the date will change in this case you want to find something else like the button class maybe or even the innertext of download (as a last resort) Quote Link to post Share on other sites
ZonkDonkey 0 Posted January 14, 2016 Author Report Share Posted January 14, 2016 Hmm, now i'm getting a script error: http://screencast.com/t/CFSMWGds set(#download_report,$scrape attribute($element offset(<class="button_label">,0),"href"),"Global") download file(#download_report,"{$special folder("Desktop")}\\{$plugin function("File Management.dll", "$file name", #download_report)}.txt") Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 14, 2016 Report Share Posted January 14, 2016 Hmm, now i'm getting a script error: http://screencast.com/t/CFSMWGds set(#download_report,$scrape attribute($element offset(<class="button_label">,0),"href"),"Global") download file(#download_report,"{$special folder("Desktop")}\\{$plugin function("File Management.dll", "$file name", #download_report)}.txt") Can you PM me the button code or post here but leave out the full link in case it is publicly visible 1 Quote Link to post Share on other sites
ZonkDonkey 0 Posted January 14, 2016 Author Report Share Posted January 14, 2016 Can you PM me the button code or post here but leave out the full link in case it is publicly visibleHere is a screenshot: http://screencast.com/t/qbgDtlHU Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 15, 2016 Report Share Posted January 15, 2016 Well in order to not make this very complicated lets just make sure we can download it first. See if this works, i'm trying to eye it out so bare with me but I think that this should work: set(#download_report_onclick,$scrape attribute($element offset(<id="DownloadID">,0),"onclick"),"Global") set(#download_report_url,$replace($replace(#download_report_onclick,"location.href=\'",$nothing),"\'",$nothing),"Global") set(#download_report,"https://sellercentral.amazon.com{#download_report_url}","Global") download file(#download_report,"{$special folder("Desktop")}\\AMAZON.txt") And if it does we can parse out the file name so it can be named properly after. Quote Link to post Share on other sites
pash 504 Posted January 15, 2016 Report Share Posted January 15, 2016 Basic by ubothttp://wiki.ubotstudio.com/wiki/Save_Downloaded_File Windows commandhttp://wiki.ubotstudio.com/wiki/Click_Dialog_Button Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 15, 2016 Report Share Posted January 15, 2016 Download file is a lot better though as no windows pop up so if it's possible to do it that way then that is the best route. 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.