Protein Data Bankから.pdbファイルをダウンロードしようとしています。私はこれらのファイルを抽出するために以下のコードブロックを書いていますが、ダウンロードされているファイルにはWebページが含まれています。Pythonを使用してProtein Data Bankから特定の.pdbファイルをダウンロードする
#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')
ああ、愚かな私。魅力のように動作します。 – David