Advertisement
dereksir

Untitled

Nov 23rd, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. async def fetch_page(session, URL):
  2.     # Make GET request using session
  3.     async with session.get(url) as response:
  4.         # Retrieve HTML content
  5.         html_content = await response.text()
  6.         # Parse HTML content using BeautifulSoup
  7.         soup = BeautifulSoup(html_content, 'html.parser')
  8.         # Return parsed HTML
  9.         return soup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement