code: import sys 
  import asyncio
  import logging
  import warnings
  import nest_asyncio
  from typing import List, Set
  from bs4 import BeautifulSoup, Tag
  from typing import List
  from llama_index.schema import Document 
  
  IS_IPYKERNEL = "ipykernel_launcher" in sys.argv[0]
  
  if IS_IPYKERNEL:
      nest_asyncio.apply()
  
  logger = logging.getLogger(__name__)
  
  
  CONTENT_TAGS = [
      "p",
      "div",
      "span",
      "a",
      "td",
      "tr",
      "li",
      "article",
      "section",
      "pre",
      "code",
      "blockquote",
      "em",
      "strong",
      "b",
      "i",
      "h1",
      "h2",
      "h3",
      "h4",
      "h5",
      "h6",
      "title",
  ]
  
  
  def scrape(html: str) -> str:
      soup: BeautifulSoup = BeautifulSoup(html, "html.parser")
  
      content: List[Tag] = soup.find_all(CONTENT_TAGS)
  
      text_set: Set[str] = set()
  
      for p in content:
          for text in p.stripped_strings:
              text_set.add(text)
  
      return " ".join(text_set)
  
  
  async def async_load_content_using_playwright(url: str) -> str:
      
      try:
          from playwright.async_api import async_playwright
          
          async with async_playwright() as p:
              browser = await p.chromium.launch()
              page = await browser.new_page()
              await page.goto(url)
              html = await page.content()
              await browser.close()
              return html
  
      except ImportError:
              raise ImportError(
                  "`playwright` package not found, please install it with "
                  "`pip install playwright && playwright install`"
              )
  
  def load_content_using_playwright(url: str) -> str:
      return asyncio.get_event_loop().run_until_complete(
          async_load_content_using_playwright(url)
      )
  
  class LyzrWebPageReader:
      
      def __init__(self) -> None:
          pass
  
      @staticmethod
      def load_data(url: str) -> List[Document]:
          if IS_IPYKERNEL:
              warning_msg = "Running in Google Colab or a Jupyter notebook. Consider using nest_asyncio.apply() to avoid event loop conflicts."
              warnings.warn(warning_msg, RuntimeWarning)
          
          html = load_content_using_playwright(url)
          content = scrape(html)
          document = Document(text=content, metadata={"url": url})
          return [document]
  
apis: llama_index.schema.Document
extract_api: [((312, 339), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (329, 339), False, 'import logging\n'), ((281, 301), 'nest_asyncio.apply', 'nest_asyncio.apply', ([], {}), '()\n', (299, 301), False, 'import nest_asyncio\n'), ((676, 710), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (689, 710), False, 'from bs4 import BeautifulSoup, Tag\n'), ((2182, 2227), 'llama_index.schema.Document', 'Document', ([], {'text': 'content', 'metadata': "{'url': url}"}), "(text=content, metadata={'url': url})\n", (2190, 2227), False, 'from llama_index.schema import Document\n'), ((1088, 1106), 'playwright.async_api.async_playwright', 'async_playwright', ([], {}), '()\n', (1104, 1106), False, 'from playwright.async_api import async_playwright\n'), ((1609, 1633), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1631, 1633), False, 'import asyncio\n'), ((2030, 2072), 'warnings.warn', 'warnings.warn', (['warning_msg', 'RuntimeWarning'], {}), '(warning_msg, RuntimeWarning)\n', (2043, 2072), False, 'import warnings\n')]