l4ever
2020-03-10 20:57:45 +08:00
```
from bs4 import BeautifulSoup
if __name__ == "__main__":
html = """
<img src="http-url" alt="妹子" />
<img src="http-url" alt="妹子" style="height:auto !important;" />
<img src="http-url" alt="妹子" width="100%" />
"""
soup = BeautifulSoup(html, 'html.parser')
img = soup.find_all('img')
for i in img:
src = i.attrs['src']
alt = i.attrs['alt']
print(f'<mip-img src="{src}" alt="{alt}" ></mip-img>')
```