i am using java with jsoup to parse a website, trouble is , alot of the information i needed isnt surrounded by tags.
for example , each <p> below has telephone number/s for 2 different people. one person has a telephone while the other does not.
<p class="contact-info">Tel: <strong> 059-9162997</strong> | Mob: <strong>087-2280039</strong></p>
<p class="contact-info">Mob: <strong>086 7726712</strong></p>
How could i parse/ pattern match this information to retrieve
person 1 —–> 059-9162997, 087-2280039
person 2 —–> 086 7726712
Also how would i retrieve the information for this
<p class="contact-info">Address: <strong>Suite 26, Unit 1, North Park, North Road,Dublin 11, Dublin</strong> <br />Email: <a href="mailto:info@swillydrive.ie">info@swillydrive.ie</a><br />Website: <a href="http://www.swillydrive.ie">http://www.swillydrive.ie</a></p>
where
Address —–>Suite 26, Unit 1, North Park, North Road,Dublin 11, Dublin
email ——-> info@swillydrive.ie
website ——>http://www.swillydrive.ie
thanks
You can use jsoup to select some data depending on what you need, as described here.
In your case, you need to select all
ptag with thecontact-infoclass, and then thestrongtag in it. The syntax allows you do write it like this:Which, in Java, gives: