title: How to remove p tags around img tags Beautiful Soup
body: <p>I have images like </p>
  
  <pre><code>&lt;p&gt;
  &lt;img alt="" src="http://some_dummy_image.JPG" style="width: 263px; height: 306.77px;"/&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>What I do :</p>
  
  <pre><code>for x in soup.find_all("p"):
      if (len(x.get_text(strip=True)) == 0):
          img = x.findChildren("img")
              if len(img):
                   x.replaceWith(img[0])
  
  </code></pre>
  
  <p>I would just like to get rid of <p> tags wrapping around the img tag.</p>