Ha, BS can now actually parse it

This commit is contained in:
EamonnMR 2023-01-01 01:17:07 -05:00
parent 73889a9a82
commit 23866389fd

View file

@ -23,7 +23,7 @@ def register_handler(path: str):
@register_handler("/post/{id}")
def post(request: Request, id: int):
post = get(urljoin(wordpress_url, f"wp-json/wp/v2/posts/{id}")).json()
return BeautifulSoup(post["content"]).get_text()
return BeautifulSoup(post["content"]["rendered"]).get_text()
def handle(request):