Browse Source

get_license_metadata() could now raise an requests.HTTPException

shut
Niklas Rosenstein 10 months ago
parent
commit
489c93fc23
No known key found for this signature in database GPG Key ID: 6D269B33D25F6C6
1 changed files with 3 additions and 1 deletions
  1. + 3
    - 1
      src/shore/util/license.py

+ 3
- 1
src/shore/util/license.py

@ -54,7 +54,9 @@ def get_license_metadata(license_name):
license type, standard notice and license text. """
url = BASE_URL.format(license_name.replace(' ', '-').lower())
html = requests.get(url).text
response = requests.get(url)
response.raise_for_status()
html = response.text
soup = bs4.BeautifulSoup(html, 'html.parser')
extract_keys = ['Key', 'Name', 'Short Name', 'Category', 'License type',

Loading…
Cancel
Save