I am working on some projects where I need to scrap some information from different websites. I Example: Now with getHtmlElementById . . An example: HtmlUnit for this purpose, but the problem I am unable to cross through the elements on a page.
& lt; Div id = "some_id" & gt; & Lt; Div & gt; & Lt; Div & gt; & Lt; Div & gt; In between ...... many divs ...... and lt; Div id = "my_target_div" & gt; Some information & lt; / Div & gt; ........ ........ & lt; / Div & gt;
div id
div < / Div>
@Test Public Zero Receipts () Exceptions thrown {last webclient webClient = new WebClient (); Last HTML page page = webClient.getPage ("http: // some_url"); Ultimate HTML Division DIV = Page.Gate HTML Element BIID ("my_target_div"); WebClient.closeAllWindows (); }
No comments:
Post a Comment