I am trying to get an input element from this web:
https://www.milanuncios.com/textos-del-anuncio/?demandax=n&c=131&idlocalidad=8&p=almeria&x=27&y=0
The input itself is:
<input class="inputs campoGrande" name="marca" value="" maxlength="120" size="12" id="marca" tabindex="1" type="text">
I have tried different approaches but all I always get is a "null" reference:
HtmlInput inputZona = (HtmlInput) currentPage.getElementById("marca");
HtmlInput inputZona = (HtmlInput) currentPage.getFirstByXPath("//input[@name='marca']");
Also tried JSoup with same results :-(
Both, HTMLUnit and XPAth fail to get the item.
What is going on with this?
Thanks in advance,
Jose
This code works here with the latest version of HtmlUnit (2.28-SNAPSHOT).
public static void main(String[] args) throws Exception {
WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED);
HtmlPage page = webClient.getPage("https://www.milanuncios.com/textos-del-anuncio/?demandax=n&c=131&idlocalidad=8&p=almeria&x=27&y=0");
System.out.println(page.asXml());
HtmlInput inputZona = (HtmlInput) page.getElementById("marca");
System.out.println(inputZona.asXml());
}