I apologise if this is a stupid question....
I am trying to create a java application to open a url, run a series of actions on it and then print the page I can open the page easily, but i have a problem in that the page has a number of twisty like expand boxes. I would like to be able to access these with the java app and expand all of them before printing the document, as not expanding them causes the document to be printed without the details below the expand box.
<P>
<TABLE id=expandTable class=expTable width="100%" count="25">
<TBODY>
<TR class=expTitleMout onmouseover="className='expTitleMin'" onmouseout="className='expTitleMout'">
<TD class=expTitle onclick=collapse(25,1) vAlign=top width=18><SPAN contentEditable=false width="100%"><IMG id=img_expSection_25 src="images/kms_dt_expand.gif"></SPAN></TD>
<TD class=expTitle onclick=collapse(25,1) width="100%">
<DIV>*****HEADING HERE*****: </DIV></TD></TR>
<TR>
<TD id=expSection_25 class=expDataB colSpan=2>
<UL>
<LI>****** CONTENT HERE *******<BR></LI></UL></A></TD></TR></TBODY></TABLE></P>
I am trying to find out if there is some way to address the script function that expands this text. Looking at it with selenium, selenium gives me a chunk of java code, but i am having major issues installing the selenium plug in for Netbeans.
If anyone has any way for me to create a line of code in Java that will allow me to address these functions and make sure they are expanded I would highly appreciate it. hate to have to ask for help but I have done about 6 hours of research on this by now, and think my Google-Fu is crippled as i can find nothing to help. Please find the script i am using for accessing the url below
package openuri;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
/**
*
* @author gbreytenbach
*/
public class OpenURI {
public static void main(String[] a) {
String baseURL = "https://someurl.com/";
String docID = "SOME SUFFIX";
String docURL = baseURL+docID;
try {
URI uri = new URI(docURL);
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
if (desktop != null)
{
desktop.browse(uri);
}
} catch (IOException | URISyntaxException ioe) {
}
}
}
EDIT: Thanks for the 2 very quick answers. Maybe I should provide more details ;) the function i am trying to run on the page is a print function that looks as follows:
<td id="print" nowrap="nowrap">
<span id="tbPrint">
<a onclick="return printPage('Published')" href="#">Print</a>
</span>
</td>
Using .doclick, would it allow me to run the print function programmatically?