From: Davi M. C. <dav...@gm...> - 2016-07-09 03:03:11
|
Hello, I'm doing a system which need to fill some fields the following website: https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ To be more precise, I am trying to insert a symbol in the list of symbols that site, using, for this, the input field "Adicionar Símbolo". <input class="wl-symbol-edit" placeholder="Adicionar Símbolo" maxlength="1000" style="text-transform: none; font-weight: normal;" autocomplete="off" type="text"> Therefore, I wrote the following code: BrowserVersion browserVersion = BrowserVersion.INTERNET_EXPLORER_11; webClient = new WebClient(browserVersion); webClient.getOptions().setCssEnabled(true); webClient.setSyncAjaxMode(new SyncAjaxController()); webClient.getOptions().setJavaScriptEnabled(true); HtmlPage page = webClient.getPage(url); List<Node> nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); if (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() > 0) { HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo. get(0); HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type("BBAS3\n"); System.out.println(page.asXml()); } However, the println does not return the below structure, as in the website. <div class="symbol"><span class="name">BBAS3</span>... What am I doing wrong? |