How can bot know all files from the website are downloaded?

I have a list of HAWB numbers. From a webiste, for each HAWB number I enter into the website, there would be a few pdf files appear (each with a button “View” behind it).
I can use logo “View” to open and save the pdf file.
My issue is that the number of the pdf files is not fixed for each HAWB. How can the bot knows all the files are downloaded and should start to run for next HAWB?

Have you tried reading the xpath properties of the “view” buttons for one HAWB number? Maybe it contains some kind of identifier that lets you determine if there are more view buttons on that page. Possibly combining that with an exception handling action could do the job.

1 Like

Thanks. Let me try it out.

Maybe example 3 from the Xpath guide might be helpful, too.
It uses loops and Xpaths with an identifier that increases by 1 in each loop.

The web element and loop work well. However, as the number of the file list is not consistent for different HAWB, I have difficulty to get the “link_list”.

Maybe, you could use something like this:

  • create a blank variable that will have a particular value if there is no more view buttons on the page
  • use Exception handling and put all action to click the View button and download thr file inside it
  • if the exception occurs, assign a value to the variable
  • put all actions in the While (variable is empty) loop

Here is an example based on the example 3 from the Xpath guide:

1 Like

thanks. it works perfectly:)

1 Like