<html lang="en-us">
  <head>
    <!-- Header -->
  </head>
  <body class="">
    <div id="container">
      <div id="sub-header"></div>
      <div id="global-warning"></div>
      <div id="global-info"></div>
      <!-- Content -->
      <div id="content">
        <div id="sidebar" class="box"></div>
        <h1></h1>
        <p class="comp"></p>
        <p class="comp"></p>
        <p class="comp">
          <b>Decompose Into:</b>
          <a href="/materials/entry/635950">Cu</a> " + "
          <a href="/materials/entry/1376409">Li
            <sub>3</sub>
            Cu
            <sub>2</sub>
          </a> " + "
          <a href="/materials/entry/2621">Na
            <sub>3</sub>
            Cu
            <sub>2</sub>
            S
            <sub>2</sub>
          </a>
        </p>
      </div>
      <!-- Sidebar -->
      <div id="footer"></div>
      <div id="footer"></div>
      <svg id="js-plotly-tester" xmlns:xlink="http://www.w3.org/1999/xlink" style="position: absolute; left: -10000px; top: -10000px; width: 9000px; height: 9000px; z-index: 1;"></svg>
    </div>
  </body>
</html>


import nest_asyncio
import asyncio
import aiohttp
from bs4 import BeautifulSoup

# Allow nested event loops in Colab
nest_asyncio.apply()

async def fetch_decompose_into_aiohttp(material):
    url = f"https://oqmd.org/materials/composition/{material}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
                      "AppleWebKit/537.36 (KHTML, like Gecko) "
                      "Chrome/58.0.3029.110 Safari/537.3"
    }
    async with aiohttp.ClientSession(headers=headers) as session:
        try:
            async with session.get(url) as response:
                if response.status != 200:
                    return f"Failed to fetch data: Status {response.status}"
                html = await response.text()
                soup = BeautifulSoup(html, 'html.parser')
                
                # Find the "Decompose Into" section
                decompose_label = soup.find('b', text="Decompose Into:")
                if not decompose_label:
                    return "Decompose Into information not found."
                
                # Find the parent <p> tag containing the decomposition links
                decompose_content = decompose_label.find_next("p", class_="comp")
                if not decompose_content:
                    return "Decompose Into information is unavailable in the expected format."
                
                # Extract decomposition phases
                phases = []
                for a_tag in decompose_content.find_all("a"):
                    phase_name = ''.join([sub.text if sub.name == 'sub' else sub for sub in a_tag.contents])
                    phase_link = a_tag['href']
                    phases.append({"name": phase_name.strip(), "link": f"https://oqmd.org{phase_link}"})
                
                return phases
        except Exception as e:
            return f"An error occurred: {str(e)}"

# Execute the async function using an event loop
material = "NaLiCu2S2"  # Replace with desired material composition
decompose_info = asyncio.get_event_loop().run_until_complete(fetch_decompose_into_aiohttp(material))

# Print the extracted decomposition information
if isinstance(decompose_info, list):
    print(f"Decompose Into Phases for {material}:")
    for phase in decompose_info:
        print(f" - {phase['name']}: {phase['link']}")
else:
    print(decompose_info)


    print(f"Decompose Into Phases for {material}:")
import nest_asyncio
import asyncio
import aiohttp
from bs4 import BeautifulSoup

# Allow nested event loops in Colab
nest_asyncio.apply()

async def fetch_decompose_into_aiohttp(material):
    url = f"https://oqmd.org/materials/composition/{material}"
…    print(f"Decompose Into Phases for {material}:")
    for phase in decompose_info:
        print(f" - {phase['name']}: {phase['link']}")
else:
    print(decompose_info)

Decompose Into information not found.
<ipython-input-27-a62f78a4d070>:25: DeprecationWarning: The 'text' argument to find()-type methods is deprecated. Use 'string' instead.
  decompose_label = soup.find('b', text="Decompose Into:")

not working properly 

adjuet the code and return total code