title: Need to run Playwright Sync API inside Asyncio Loop
body: <p>I am currently working on creating a Discord Bot using the Discord.py library. One of the tasks the bot has is to use other APIs to check for the latest Youtube Video, TikTok, etc. For parsing through the Tiktok content I am using the <a href="https://github.com/davidteather/TikTok-Api" rel="nofollow noreferrer">TikTokApi</a>. I have a scheduled task in my discord bot client that is going to run every 5 minutes:</p>
  <pre><code>def check_toks():
  es_link = tktok.Tktok_catcher(&quot;ES&quot;)
  en_link = tktok.Tktok_catcher(&quot;US&quot;)
  print(es_link, en_link)
  
  @tasks.loop(minutes=5)
  async def check_platforms():
      es_link = tktok.Tktok_catcher(&quot;ES&quot;)
  </code></pre>
  <p>Running the following code gives me the following error:</p>
  <pre><code>playwright._impl._api_types.Error: It looks like you are using Playwright Sync API inside the asyncio loop. 
  Please use the Async API instead.
  </code></pre>
  <p>Is there a workaround for this problem (a way to run the playwright sync API inside the Asyncio loop) or is there something I need to change in the library that I am using to get it to work?</p>