I have been trying to download .pdb files from the Protein Data Bank. I have written the following block of code to extract these files however I the files being downloaded instead contain the web page.
#Sector C - Processing block:
RefinedPDBCodeList = [] #C1
with open('RefinedPDBCodeList') as inputfile:
for line in inputfile:
RefinedPDBCodeList.append(line.strip().split(','))
print(RefinedPDBCodeList[0])
['101m.pdb']
import urllib.request
for i in range(0, 1): #S2 - range(0, len(RefinedPDBCodeList)):
path=urllib.request.urlretrieve('http://www.rcsb.org/pdb/explore/explore.do?structureId=101m', '101m.pdb')