Jump to content
UBot Underground

Save File (With Original File Name)


Recommended Posts

I'm having an issue trying to save a file. For instance, the bot will:

 

1. Click the "Download" button

2. 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_File
I am unable to use the original file name.

 

Any help is appreciated.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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)}")
  • Like 1
Link to post
Share on other sites

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!

Link to post
Share on other sites

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)

Link to post
Share on other sites

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")

Link to post
Share on other sites

 

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

  • Like 1
Link to post
Share on other sites

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.

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...