summaryrefslogtreecommitdiff
path: root/Code/download_ena_experiment_records.py
blob: f3c91262c2d4e47b3a71462a8d97ee932684f170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Given an experiment's accession SRX6711770, get its full information from the following link
# https://www.ebi.ac.uk/ena/browser/api/xml/SRX6711770

import urllib.request

def get_xml_for_experiment_id(eid):
    url = 'https://www.ebi.ac.uk/ena/browser/api/xml/%s' % (eid)
    content = ''
    with urllib.request.urlopen(url) as response:
        content = response.read()
    return content.decode('utf-8')



if __name__ == '__main__':
    print(get_xml_for_experiment_id('SRX6711770'))