Jump to content
UBot Underground

Handling A "save As" Pop Up - File Already Downloaded


Recommended Posts

Hello all -

 

I'm doing a simple bot to go into a site, do a search, click a link to generate a CSV and save the CSV.  Once that is working, I want to loop.

 

I did find another post discussing saving the file (I forget whose topic, sorry) saying to use "save downloaded file" - which is working.  But not as expected.

 

I click the hyperlink to download the CSV and then have the "Save Downloaded File" tag

 

The file quietly saves into the folder I specify, with the file name I specify (I know when I loop I have to change that file name to a variable)

 

However, the O/S or Browser generated "Save As" dialog window is still on screen.  Even if UBot ignores it and continues, it will loop and loop continuing additional dialogue boxes - and that is assuming that the underlying browser doesn't wait for me to manually close it.

 

Is there a command to close open dialogs?  How would you handle this?

 

Thanks

 

Chris

Link to post
Share on other sites

I actually got it to work like this: 

click(<class="all">,"Left Click","No")  // This is the link to start the download
save downloaded file("D:\\Downloads\\my-save-folder\\my-file-name.csv")
wait(1.5)
plugin command("WindowsCommands.dll", "click dialog button", "Save As", "Cancel")

Is this the "right" way?  Is there a better / more stable way?

 

Thanks

Edited by pokerdawg
Link to post
Share on other sites

I "clicked" on the link which triggers a browser / OS "save as" dialogue box.

 

The save download file is downloading the file properly, and I'm opening the CSV, with the CSV results I expect

 

The last statement instantly closes the pop up so I don't see it.

 

When I'm saying "pop up" it isn't a CSS / Ajax / JS pop up.  It's what you would get if you right-click on a CSV/PDF link on a page, and it gives you a "save as" option.

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