SAve file Chrome

Hello friends,
@rkelchuri, @Ninett_Panfir, @Rammohan91, @balupad14, @Florent_Salendres, @vvaidya, @Palaniyappan, @ClaytonM, @vvaidya, @lakshman, @Dave,

how can I save a file in Chrome that opens in an another page?
When I click on the flag, the pdf file opens in another page.
How can I save it?


Thak you,
Cami

Fine
did send hot key with CTRL + p which would try to print where we can save that pdf, work upon that page
Cheers @CamiCat

Thank you @Palaniyappan,
can you please share screenshots of details of activities?
Cami

2 ways that i (almost) always do to save files from the internet

  1. Get the URL of the link (using get attribute activity on the UiElement and getting the URL attribute), then use HTTP Request activity to save it to filepath of your choice. This is my preferred method as it is the quickest and relies on UI less so it can work better in the background.

  2. Right click on the link, click ‘save target as’ then type in the full file path (including extension) to where you’d like to save it. This works 100% of the time, but requires the browser to be visible because right click does not work with SendWindowsMessages or with SimulateClick

1 Like

Thank you @Dave
can you please provide xaml of how to do scenario 1?
Thank you
Cami

If the PDF opens in a new tab or page as a PDF, use ctrl+shift+s to save it. Don’t use ctrl+p; Print is only for non-PDF files

Test the keystroke manually first to ensure the ctrl+shift+s will work. Then, just use the Send Hotkey activity on the pdf selector.

1 Like

Sure thing, let me know if you have any questions. and you’re supposed to grab the attribute ‘href’ not ‘url’ from the looks of it, whoops.

CamiCat.xaml (8.7 KB)

Thank you @ClaytonM,

can you provide screenshot of the activity?
I should make it work in background,
Cami

This works in Unattended runs, but if you are looking for background Attended, then you might need to try using the TypeInto where you can Simulate both the keystroke and the click. A click might be needed to activate the pdf container. For TypeInto, use the string "[d(rctrl)][d(rshift)]s[u(rctrl)][u(rshift)]"

The selector should include the pdf container as shown in the image.

Regards.

Thank you @ClaytonM,
also the Typeinto desn’t work in background.
Can you please ahhtach screenshot or xaml?
Thank you,
cami

Thank you @ClaytonM,

how to check if the pdf is loaded on the web page?
Thank you,
Cami

There are a couple things you might need to do…

First is, use the TimeoutMS property on the first action that performs in the pdf container on the browser - you should be using the selector for the pdf viewer/container in the browser. This could be done on the ctrl+shift+s action

Second is, surround the ctrl+shift+s action with a Retry Scope until the Save As element shows up. This can prevent timing issues where the keystroke performs before the pdf is loaded. - this usually is not needed, and TimeoutMS can work by itself, but sometimes the pdf container has timing issues

Regards.

1 Like

Thank you so much @ClaytonM,

can you please show me with screenshots how to perform the second option?
Thank you so much,
Cami :slight_smile: