Is it possible to extract the IMG tag (or just the src attribute of an IMG tag) from a block of HTML in Ruby?
For example, if I have a block of HTML such as:
<p>Lorem ipsum dolor sit amet, labore et dolore magna aliqua.<img src="example.jpg" alt="" /> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
Could I extract just the IMG tag or src of that IMG tag via Regex or some other method?
Thanks in advance for any suggestions!
Using Nokogiri: