Automatically download a text file
songeurs
Posted messages
11
Status
Member
-
songeurs Posted messages 11 Status Member -
songeurs Posted messages 11 Status Member -
Hello,
Currently, on Windows 10, I connect to a website using Firefox to download a text file; for this purpose:
1) I log in to the site (https://www...) which displays a screen,
2) I click on the radio button corresponding to the file to retrieve,
3) I click on the "Download" button, then a window appears with two radio buttons allowing:
- either to open the file (in this case I indicate that I want to open it with "Notepad", then I save it myself),
- or to save the file (in this case the file is saved in the standard "Downloads" directory),
4) after choosing one of these two actions, I click on the "OK" button.
The file retrieval always works without any problem.
In order to automate the retrieval of this file every evening, I am first looking to create a command that would allow it to be downloaded, which would mean automatically performing each of the actions 1 to 4 above.
My first question: is this achievable using JavaScript?
Thank you in advance for your help.
Currently, on Windows 10, I connect to a website using Firefox to download a text file; for this purpose:
1) I log in to the site (https://www...) which displays a screen,
2) I click on the radio button corresponding to the file to retrieve,
3) I click on the "Download" button, then a window appears with two radio buttons allowing:
- either to open the file (in this case I indicate that I want to open it with "Notepad", then I save it myself),
- or to save the file (in this case the file is saved in the standard "Downloads" directory),
4) after choosing one of these two actions, I click on the "OK" button.
The file retrieval always works without any problem.
In order to automate the retrieval of this file every evening, I am first looking to create a command that would allow it to be downloaded, which would mean automatically performing each of the actions 1 to 4 above.
My first question: is this achievable using JavaScript?
Thank you in advance for your help.
4 answers
Hello,
4 steps for an action!
Quite complicated, right?
Just keep the essentials: the last step: download a file.
"This would amount to automatically performing each of the actions 1 to 4 above."
No, only the download of the file is necessary, inform yourself about the URL directly.
"My first question:"
should be to focus on downloading the file only, otherwise it's not called automation and you're wasting your time (opening a site, activating a button, obtaining the URL, opening it in the browser).
Is this achievable using JavaScript?
More or less, it depends on which step and it is not suitable, JavaScript does not allow you to download a file (thankfully, otherwise hello viruses when opening a site) and that is the role of the browser which uses the network.
JS = manipulate the content of a document (page/DOM) on the client side, possibly using the server.
Better suited:
find how to automate/script the browser or connect to the network with a language that allows this for the download request.
4 steps for an action!
Quite complicated, right?
Just keep the essentials: the last step: download a file.
"This would amount to automatically performing each of the actions 1 to 4 above."
No, only the download of the file is necessary, inform yourself about the URL directly.
"My first question:"
should be to focus on downloading the file only, otherwise it's not called automation and you're wasting your time (opening a site, activating a button, obtaining the URL, opening it in the browser).
Is this achievable using JavaScript?
More or less, it depends on which step and it is not suitable, JavaScript does not allow you to download a file (thankfully, otherwise hello viruses when opening a site) and that is the role of the browser which uses the network.
JS = manipulate the content of a document (page/DOM) on the client side, possibly using the server.
Better suited:
find how to automate/script the browser or connect to the network with a language that allows this for the download request.