def gather_git_command_html_files():
 command_list_html = session.get(git_docs_base_url)
 soup = BeautifulSoup(command_list_html.text, 'html.parser')
 links = soup.find_all('a')
 commands = []
 for link in links:
  href = link.get('href')
  if ('/docs/git-' in href):
   href = href.replace('/docs', '')
   with open('download/{}.html'.format(link.text), 'wb') as outfile:
    outfile.write(bytes(session.get('{}{}'.format(git_docs_base_url, href)).text, 'UTF-8'))

def gather_git_command_html_files ( ) : command_list_html = session . get ( git_docs_base_url ) soup = BeautifulSoup ( command_list_html . text , 'html.parser' ) links = soup . find_all ( 'a' ) commands = [ ] for link in links : href = link . get ( 'href' ) if ( '/docs/git-' in href ) : href = href . replace ( '/docs' , '' ) with open ( 'download/{}.html' . format ( link . text ) , 'wb' ) as outfile : outfile . write ( bytes ( session . get ( '{}{}' . format ( git_docs_base_url , href ) ) . text , 'UTF-8' ) )
basic function for collecting the list of git commands that we need to get individual html files for .