I'm having some trouble in a simple programming problem, and after getting stuck, I have decided to ask for help.
Context of the problem: I have a test website like "https//https://ift.tt/3rAZmeK" that has a .pdf file in it. It is known to me that the id number is created linearly (there is a 9998, 9997 and so on), but not every id has a .pdf file.
The goal is to make a script that will get that url and decrease the id number by 1 each step and then show any instances that has a .pdf in it.
I had an idea on how to keep testing id over id, but I have not figured out how do I put together the "show/retrieve" the .pdf files from succesful instances.
My idea is just creating a variable 'id', that will be decreased then appended to "https//www.site.com/.../id=" in the iterations.
How can I download the .pdf files if they happen to exist? Can I label the donwload like id.pdf so I know which instance has it come from?
Sorry and thanks in advance.
source https://stackoverflow.com/questions/68550154/web-script-for-retrieving-site-files-from-successful-request
Comments
Post a Comment