Hey Guys,
I am trying to access a function at the following website - Listed Companies - all ASX, NZX, NSX and BSE
There is a button there (only one) that will enable me to view all the data i need, however i am having a lot of trouble calling that java script function from my java program.
From What i can tell the function is called - javascript:__doPostBack('btnShowAll','')
Here is what i have tried to do (trust me Ive tried lots of variations) -
URL servAddress = new URL("http://www.delisted.com.au?javascript:__doPostBack('btnShowAll','')"); URLConnection add = servAddress.openConnection(); URLConnection add = servAddress.openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader(add.getInputStream())); while ((companyData = in.readLine()) != null) { System.out.println("HTML: "+companyData); }
From what i know about javascript (not much) once i have the connection open (as i would in a standard internet browser) i should be able to remove the url and call the function directly - see YouTube - ‪JavaScript hack‬‎. But so far that has not worked either.
Ive tried various URL links such as -
etc etcURL servAddress = new URL("http://www.delisted.com.au?javascript:__doPostBack('btnShowAll','')"); URL servAddress = new URL("http://www.delisted.com.au#javascript:__doPostBack('btnShowAll','')"); URL servAddress = new URL("http://www.delisted.com.au/javascript:__doPostBack('btnShowAll','')"); URL servAddress = new URL("http://www.delisted.com.au/javasc#ipt:__doPostBack('btnShowAll','')"); URL servAddress = new URL("http://www.delisted.com.au?javascript:__doPostBack('btnShowAll','0')");
Thanks for any help in advance.