I have some HTML code like this:
<p>aaa</p>bbb
<p>ccc</p>ddd
How can I get ‘bbb’ and ‘ddd’?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can read the subsequent sibling of each
ptag (note this is very specific to this text, so hopefully it can be expanded to your situation):This picks up the trailing newline, so you can strip it off if need be:
The general idea is that you locate the tag(s) before your target text and then find the next sibling element, which should be your text.