Skip to content

Commit

Permalink
Switch URL for prog info scraping to use the OPO site
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Dec 18, 2024
1 parent a2fec04 commit d133cf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2057,12 +2057,15 @@ def text_scrape(prop_id):
program_meta : dict
Dictionary containing information about program
"""
# Ensure prop_id is a 5-digit string
prop_id = str(prop_id).zfill(5)

# Generate url
url = 'http://www.stsci.edu/cgi-bin/get-proposal-info?id=' + str(prop_id) + '&submit=Go&observatory=JWST'
url = f'https://www.stsci.edu/jwst-program-info/program/?program={prop_id}'
html = BeautifulSoup(requests.get(url).text, 'lxml')
not_available = "not available via this interface" in html.text
not_available |= "temporarily unable" in html.text
not_available |= "internal error" in html.text

program_meta = {}
program_meta['prop_id'] = prop_id
Expand Down

0 comments on commit d133cf8

Please sign in to comment.