I have two questions(problems actually) while parsing the html page using HtmlUnit
.I tried their 'Getting Started` as well as searched google but no help.Here is my first problem.
1) I want to extract the text of following bold
tag from the page
<b class="productPrice">Five Dollars</b>
2)I want to extract the entire text(including further span or link text,if present) in the last paragraph in the following structure
<div class="alertContainer">
<p>Hello</p>
<p>Haven't you registeret yet?</p>
<p>Registrations will close on 3 July 2012.<span>So don't wait</span></p>
</div>
Can you please one-line code snippets how can I do that?I am new to HtmlUnit.
EDIT:
HtmlUnit has getElementByName()
and getElementById()
, so what do we use if we want to select using class?
This will be the answer to my first question.