私はclinicalTrials.govからデータをスクレイプする小さなPython関数に取り組んでいます。各研究記録から、研究が対象とする条件を掻き集めたいと思う。例えば、私は次のことをしたいthis研究記録のために:clinicalTrials.govのデータをスクラップ
conditions = ['Rhinoconjunctivitis', 'Rhinitis', 'Conjunctivitis'. 'Allergy']
しかし、各研究レコードに、条件の異なる番号があります。
b'Condition or disease'
b'Intervention/treatment'
b'Phase'
b'Rhinoconjunctivitis'
b'Rhinitis'
b'Conjunctivitis'
b'Allergy'
b'Drug: Placebo'
b'Biological: SCH 697243'
b'Drug: Loratadine Syrup 1 mg/mL Rescue Treatment'
b'Drug: Loratadine 10 mg Rescue Treatment'
b'Drug: Olopatadine 0.1% Rescue Treatment'
b'Drug: Mometasone furoate 50 mcg Rescue Treatment'
b'Drug: Albuterol 108 mcg Rescue Treatment'
b'Drug: Fluticasone 44 mcg Rescue Treatment'
b'Drug: Prednisone 5 mg Rescue Treatment'
b'Phase 3'
は、どのように私は今だけ介入/治療情報なし条件を得ることができますので、同じよう
page = requests.get('https://clinicaltrials.gov/ct2/show/study/NCT00550550')
soup = BeautifulSoup(page.text, 'html.parser')
studyDesign = soup.find_all(headers='studyInfoColData')
condition = soup.find(attrs={'class':'data_table'}).find_all('span')
for each in condition:
print(each.text.encode('utf-8').strip())
:私は、データを取得し、次のスクリプトを書かれていますか?