Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) https://www.hl7.org/fhir/valueset-account-status.html
- 2) https://www.hl7.org/fhir/valueset-activity-reason.html
- 3) https://www.hl7.org/fhir/valueset-age-units.html
- import requests
- from bs4 import BeautifulSoup
- urls = [
- 'https://www.hl7.org/fhir/valueset-activity-reason.html',
- 'https://www.hl7.org/fhir/valueset-age-units.html'
- ]
- for url in urls:
- r = requests.get(url)
- soup = BeautifulSoup(r.content, 'lxml')
- h2 = soup.find(lambda elm: elm.name == "h2" and "Content Logical Definition" in elm.text)
- table = None
- for sibling in h2.find_next_siblings():
- if sibling.name == "table":
- table = sibling
- break
- if sibling.name == "h2":
- break
- print(table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement