-1

how can i extract the text from this html snippet...

<span id='amount'>&pound;86,950</span></div>
                    <p class="bedrooms">2 bed mews house for sale</p>
                    <h2 class="address">
                        <a href="...31073581.html?showcase=true&premiumA=true">Wilson Street,city 123 
</a></h2>

i want to extract

£86950
2 bed mews house for sale
Wilson Street,city 123

im using regexbuddy and i can extract value $pound567849 (via &pound.*\d)

i can extract value of next tag via <p calss.*>.*</p> (cant use them both together..dont know how to)

but i dont know how to combine two expressions to get there values collectively...can anybody help plz (sadly new to regex and extracting things)

Passerby
  • 9,715
  • 2
  • 33
  • 50
engineer41
  • 81
  • 4
  • 15

1 Answers1

0

you can use this one (?<=(amount|bedrooms)["']>)(.+?)(?=<) to get array of values

or this one amount'>(.+?)<.*?bedrooms">(.+?)< your value would be at group 1 and 2

burning_LEGION
  • 13,246
  • 8
  • 40
  • 52