Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch URL for prog info scraping to use the OPO site #1662

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading