How to extract paragraph using regular expression


Before thanks for great tool :)

I have question how to extract all contents from paragraph, for example:

<div class=description>
<p> paragraph 1 </p>
<p> paragraph 2 </p>
<p> paragraph 3 </p>

I use simple regex  <div class=description> <p>([^<]+) , But only get first paragraph. Please advice


Posted by 1 years ago

If you want complete description, use this regular expression (.*?) It will extract everything between the given tags.

Example usage

<div class=description>(.*?)</div>

regex tester in website scraping

Posted by 1 years ago

Topic Closed! This question is closed and don't accept posts now.

Close me