How to get the correct RefSeq Protein transcript for a given RefSeq Nucleotide transcript?
There is another simple way for human sequences. 

Go to RefSeq FTP and download the LRG_RefSeqGene file. This file contains updated mappings between the gene, mRNA and protein sequences (latest versions).

From README:

    Tab-delimited file reporting, for each Gene, the accession.version
      of the genomic and RNA and protein RefSeqs the RefSeqGene/LRG 
      project treats as reference standards.  

    The columns are:
      NCBI taxonomy id (all 9606)
      GeneID 
      Symbol of the gene (official from HGNC when available)
      Accession.version of the standard RefSeq
      Term describing the RefSeq 
         RefSeqGene              genomic sequence
         Ref Std, nucleotide     RNA sequence
         Ref Std, protein        protein sequence

      The LRG equivalent of the RefSeq standard
         LRG:                    genomic sequence
         t1                      locations for transcript 1
         p1                      CDS from transcript 1

         NOTE: t values can be &gt; 1 ,  the integer assigned to t
               is matched by the integer assigned to p


Some few lines from the file:

9606    3329    HSPD1   NG_008915.1     NM_199440.1     NP_955472.1     reference standard
9606    3329    HSPD1   NG_008915.1     NM_002156.4     NP_002147.2     aligned: Selected
9606    3336    HSPE1   NG_008914.1     NM_002157.2     NP_002148.1     reference standard
9606    3339    HSPG2   NG_016740.1     NM_005529.6     NP_005520.4     reference standard


It is not that easy for other organisms. For them, you should either parse the mRNA page to find the RefSeq protein id or go to their specific designated databases (such as FlyBase for Drosophila) and obtain information on the gene to protein mapping. 

For obtaining RefSeq records from NCBI using parsing you should first obtain the GI accession number corresponding to the mRNA.

Example: NM_007393 (mouse beta-actin)

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nucleotide&amp;term=NM_007393


which would give the GI accession number: 930945786. 

Then fetch the protein GI using this accession number:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=nucleotide&amp;db=protein&amp;id=930945786


which gives the GI accession number: 6671509

Finally get the RefSeq id (if available) corresponding to this GI accession. You can download the feature table and look for the RefSeq i.d:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=nucleotide&amp;db=protein&amp;id=930945786&amp;rettype=ft


For more information on how to use Entrez E-Utilities see here.