How to programmatically submit a filled form and scrap the resulting page?

pubsskakash

New Member
I want to retrieve a set of results, which consist of all results produced by (looping) all the options of one of the request-form fields.I'm using Java language, and HtmlUnit API.I have managed to do this looping form-fill using the URL to 'fill' the field's variables (I don't know if its the best method, and actually am quite worried it's one of the worst...But it's the one i could do with the knowledge i have).But i'm having problems figuring out how to make the program submit the form in order to reach the result page, and on how to download (scrap) that page before moving to the next.NOTES:-If you have a better way of filling the 'request-form', that is welcome as well.Update:This solves the issues when using HtMlUnit API (thank you touti):\[code\]HtmlPage resultado = pageNow.getElementByName("buscar").click();System.out.println(resultado.asText());\[/code\]A better way than loading both the request and response pages is still hugely welcome tough...You can add it as a comment.
 
Back
Top