Created
May 26, 2022 10:41
-
-
Save kieranjol/7c0574c9b451fd1715cc671e1a808822 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
from bs4 import BeautifulSoup | |
brunnhilde_report = sys.argv[1] | |
with open(brunnhilde_report, 'r', encoding='utf8') as fo: | |
bla = fo.read() | |
soup = BeautifulSoup(bla, 'html.parser') | |
forks = soup.find_all('ul') | |
for fork in forks: | |
# there is surely a better way to do this | |
content = fork.contents | |
for data in content: | |
for items in data: | |
if 'AppleDouble' in items: | |
fork.decompose() | |
dotfiles = soup.find_all('tr') | |
for dotfile in dotfiles: | |
content = dotfile.contents | |
for data in content: | |
for items in data: | |
if '/.' in items: | |
dotfile.decompose() | |
with open("output1.html", "w", encoding='utf-8') as file: | |
file.write(str(soup)) | |
print("%s created" % os.path.join(os.getcwd(), "output1.html")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment