获取特定 NCT ID 历史记录的临床试验

clinical trial for getting history for particular NCT ID

我需要来自站点的特定临床试验 NCT ID 的完整历史记录:https://clinicaltrials.gov/

考虑NCT id :NCT03245346

来自 link I am checking for History of Changes which is giving me all history for that NCT ID in new page.

我可以使用 HTML 解析器得到这个:

import BeautifulSoup
import requests

url = 'https://clinicaltrials.gov/ct2/archive/NCT03245346'
r=requests.get(url)
url=r.content
soup = BeautifulSoup(url, 'html.parser')

tab = soup.find("table", {"class":"ct-data_table tr-data_table tr-tableStyle"})
print(tab)

但是为了避免HTML页面格式,我想知道,有没有API可以获取特定NCT ID的完整历史记录?

如果你只想得到table,你可以试试pandasread_html()函数:

import pandas as pd

url = "https://clinicaltrials.gov/ct2/archive/NCT03245346"

df = pd.read_html(url)[0]

df.head()

    0                               1
0   ClinicalTrials.gov Identifier:  NCT03245346
1   Study Title:                    Effects of Epidural Anesthesia and Analgesia o...
2   First Submitted:                August 2, 2017
3   Last Update Posted:             April 24, 2018

这也适用于更多 "detailed" 概览,当您单击 继续查看 ClinicalTrials.gov 存档站点 上此研究的更改历史记录时:

url_detail = "https://clinicaltrials.gov/ct2/history/NCT03245346"

df = pd.read_html(url_detail)[0]

但是,如果您正在寻找其他东西,也许我们也可以解决这个问题。