def fix_headers(soup, data):
 header_rows = soup.find_all('th')
 for t in header_rows:
  if ('Version:' in t.text):
   if (t.next_sibling.text == '$Revision$'):
    t.parent.extract()
   if (t.next_sibling.text == ''):
    t.parent.extract()
  if ('Last-Modified:' in t.text):
   if ('$Date$' in t.next_sibling.text):
    t.parent.extract()
   if (t.next_sibling.text == ''):
    t.parent.extract()
  if (t.text == 'Title:'):
   data['title'] = t.next_sibling.text
  if (t.text == 'Content-Type:'):
   t.parent.extract()
  if (('Version:' in t.text) and ('N/A' in t.next_sibling.text)):
   t.parent.extract()
 return (soup, data)

def fix_headers ( soup , data ) : header_rows = soup . find_all ( 'th' ) for t in header_rows : if ( 'Version:' in t . text ) : if ( t . next_sibling . text == '$Revision$' ) : t . parent . extract ( ) if ( t . next_sibling . text == '' ) : t . parent . extract ( ) if ( 'Last-Modified:' in t . text ) : if ( '$Date$' in t . next_sibling . text ) : t . parent . extract ( ) if ( t . next_sibling . text == '' ) : t . parent . extract ( ) if ( t . text == 'Title:' ) : data [ 'title' ] = t . next_sibling . text if ( t . text == 'Content-Type:' ) : t . parent . extract ( ) if ( ( 'Version:' in t . text ) and ( 'N/A' in t . next_sibling . text ) ) : t . parent . extract ( ) return ( soup , data )
remove empty or unwanted headers and find our title .