Ha, BS can now actually parse it
This commit is contained in:
parent
73889a9a82
commit
23866389fd
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ def register_handler(path: str):
|
||||||
@register_handler("/post/{id}")
|
@register_handler("/post/{id}")
|
||||||
def post(request: Request, id: int):
|
def post(request: Request, id: int):
|
||||||
post = get(urljoin(wordpress_url, f"wp-json/wp/v2/posts/{id}")).json()
|
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):
|
def handle(request):
|
||||||
|
|
Loading…
Add table
Reference in a new issue