Source code for https://nixnet.services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
NixNet/py/img.py

15 lines
288 B

#!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with open(sys.argv[1]) as f:
html = BeautifulSoup(f.read(), 'html.parser')
for i in html.find_all('p'):
if len(i.find_all('img')) > 0:
i.unwrap()
with open(sys.argv[1], 'w') as f:
f.write(str(html))