bgg_api/bgg_connection.py

9 lines
210 B
Python
Raw Normal View History

2024-07-25 19:58:28 +02:00
import requests
import xml.etree.ElementTree as ET
from pydantic import HttpUrl
def url_to_xml_object(url: HttpUrl) -> ET.Element:
r = requests.get(url)
root = ET.fromstring(r.content)
return root