Biopython is a module of python and the language is structured in the same way.
This particular example does not make it clear how and where to find the files and extract the data you want. First, you need to download the file and put it in a place where python will find it. Below I have an example where I was able to extract the record id. I first set up a fasta file for my code to go through and then it adds the data to a list (seq = ). The "with open" line joins my data files together. The line ends with a ":" to signal to the program that there is a block of something to do in the next line. Indentation is important in python and after a ":" the next line is indented 4 spaces.
from Bio import SeqIO
data_dir = 'data' #folder where my data files are
data_file = 'ampk.fasta' #name of file I want to get data from
seqs = 
with open(os.path.join(data_dir, data_file), "rU") as f:
for record in SeqIO.parse(f, "fasta") :
Hope this helps!