Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- group_id: xxx
- medicore_id: xxxxxxx
- date_of_visit_sample_drawn_date: xxxxxxx
- rin: xxxxxx
- donor_id: xxxxx
- sle_visit_designation: xxxxxxx
- bold_shipment_batch: xxxxxx
- rna_concentrated: xxxxxx
- subject_type: xxxxxxx
- from bs4 import BeautifulSoup
- import requests
- source= requests.get("https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?
- acc=GSM2437275").text
- soup = BeautifulSoup(source, 'lxml')
- table = soup.find_all('table')
- for i in table:
- print i.prettify()
- print (len(table)) #22 tables
- print (table[6].prettify()) #narrow down on relevant table
- table = table[6]
- table_subtables = table.find_all('table')
- for i in table_subtables:
- print (i.prettify())
- print len(table_subtables) #14 tables
- tbb = table_subtables[1]
- tbb_subtable = tbb.find_all('table')
- for i in tbb_subtable:
- print (i.prettify())
- print len(tbb_subtable) #12 tables
- tbbb = tbb_subtable[5]
- tbbb_subtable = tbbb.find_all('table')
- for i in tbbb_subtable:
- print (i.prettify())
- print len(tbbb_subtable) # 6 tables
Add Comment
Please, Sign In to add comment