3 from bs4
import BeautifulSoup
5 url=os.path.abspath(sys.argv[1])
6 report_dir = os.path.dirname(url)
10 tables=soup.find_all(
'table',recursive=
True)
11 rows = tables[2].findChildren(
'tr')
13 cells=row.findChildren(
'td')
16 href = cells[6].
find(
'a',href=
True)
18 report = href[
'href'].
split(
"#")[0]
19 report_file = os.path.join(report_dir, report)
20 if report.startswith(
"report-")
and os.path.exists(report_file):
21 os.remove(report_file)
25 print soup.prettify(
"latin1")