I am completely new to HtmlUnit and I do not really know how to read and understand the page source of a website. Nonetheless, I have written code (learned from this tutorial) to try and access the following website
Then I am stuck, as I am not familiar with javascript. This is what I want to achieve:
I would like to type
328
in the textfield on the left menu on that websiteand click submit button
So that I can be brought to the next page.
UPDATE: I managed to resolve page access problem by adding a line to my code. But I am still having trouble to locate the input text field, type in some input and click the button, so that i can be landed to the next page.
public void testing() throws Exception {
/* turn off annoying htmlunit warnings */
java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(java.util.logging.Level.OFF);
try (final WebClient webClient = new WebClient(BrowserVersion.CHROME)) {
final HtmlPage page = webClient.getPage("http://www.aastocks.com/en/stock/DetailQuote.aspx?&symbol=1");
final HtmlDivision div = page.getHtmlElementById("LeftMenu_Button");
}
}