IMGT/HLA is the database of human MHC sequences or HLA (Human Leucocyte Antigen). This code will help you to download the aligned HLA gene sequences from IMGT website in a text file. Which can be imported in database tables to do further analysis.
Use the package manager pip to install foobar.
pip install selenium
pip install BeautifulSoup4
Please update the following variables as per your need
locus = 'B'
segment = 'exon2'
mismatches = 'Show All Bases'