Java - URL connection accessing Java Scrpit Function
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) -
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 -
Code Java:
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/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')");
etc etc
Thanks for any help in advance.
Re: Java - URL connection accessing Java Scrpit Function
Please surround your code with highlight tags. If you don't know how to, see my signature block.
Have you tried this on a simpler webpage/javascript program? Try to get it working on a smaller sample then modify that code to work with the specific webpage/javascript method you are trying to call.
Incidentally, you can just run javascript from your program using the Java scripting engine. See: Scripting for the Java Platform.
Re: Java - URL connection accessing Java Scrpit Function