I want my Java application to download CSV files from http://www.nasdaqomxbaltic.com/ for example or any other site that offers data files.
How can I tell my java application to change from and to values before downloading a csv file?
The following is form for choosing date range : http://www.nasdaqomxbaltic.com/market/?pg=charts&idx_main%5B%5D=OMXBBGI. There are default from and to values assigned by website at the moment and I get CSV file including data between default from and to date.
Could you suggest any java library that can change from and to values in order to download csv file including only particular date range?
First, you can direct search by date with the following URL :
where you can give the wanted date values to these parameters:
Then the idea is to get the rendered web page. Here, you can use the Jsoup library like this :
I’m not sure about the code, but the idea is here.
EDIT :
After performing a little request, it seems that you have to perform an HTTP Get (because the file is not static and is returned on request).
Here is a little piece of code that should replace all the code below the
URL csvFileLink= new URL(href)line :