If this is a known gene then you don't need to do this manually. e.g. https://www.ncbi.nlm.nih.gov/nuccore/NM_000207.3/ is human insulin. If you look at the record you will find a link for protein sequence NP_000198.1 in that record. Or you could simply search for protein sequence directly using the name of the gene.
This returns the amino acid sequences of the canonical transcripts of the passed genes in FASTA format. You can also use isoforms=True to return the amino acid sequences of all known transcripts.
Thank you it works