0

chore: add context.close

This commit is contained in:
Matt 2024-04-22 16:38:05 +01:00 committed by GitHub
parent 3ead2efdca
commit 572b7e8dc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,7 @@ async def root(body: UrlModel): # Using Pydantic model for request body
await page.goto(body.url) # Adjusted to use the url from the request body model await page.goto(body.url) # Adjusted to use the url from the request body model
page_content = await page.content() # Get the HTML content of the page page_content = await page.content() # Get the HTML content of the page
await context.close()
await browser.close() await browser.close()
json_compatible_item_data = {"content": page_content} json_compatible_item_data = {"content": page_content}