How would i extract anchor href of given HTML, based on image src?
Example:
<a href="http://idontneedthis.com"><img src="path/to/image/1.gif" /></a>
<a href="http://iwantthis.com"><img src="path/to/image/2.gif" /></a>
<a href="http://idontneedthisagain.com"><img src="path/to/image/3.gif" /></a>
In this case i would need to get link of linked image with src of 2.gif
. That would be anchor that has href http://iwantthis.com