I want to replace all occurrences of double quotes with single quotes. But only in the img tag! I have a html text
<p>First p</p><img class="image" src="one.jpg" />
<p>Second p</p><img class="image" src="two.jpg" />
How can I replace this "in place". I tried something like this:
re.sub('"', "'", re.findall(r'<img.*/>', html))
The expected result is this:
<p>First p</p><img class='image' src='one.jpg' />
<p>Second p</p><img class='image' src='two.jpg' />