0

OBSERVATION INICIAL: Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

MY windows is 64bits, but on python consol show win32 for some reason.


Guys, I'm studying web automation with python, but I'm bumping into a question right at the beginning.

` THIS IS THE CODE BASE

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    navegador = p.chromium.launch()
Error returned

---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
Input In [15], in <cell line: 3>()
      1 from playwright.sync_api import sync_playwright
----> 3 with sync_playwright() as p:
      4     navegador = p.chromium.launch()

File ~\AppData\Roaming\Python\Python39\site-packages\playwright\sync_api\_context_manager.py:44, in     PlaywrightContextManager.__enter__(self)
     42             self._own_loop = True
     43         if self._loop.is_running():
---> 44             raise Error(
     45                 """It looks like you are using Playwright Sync API inside the asyncio loop.
     46 Please use the Async API instead."""
     47             )
     49         # In Python 3.7, asyncio.Process.wait() hangs because it does not use ThreadedChildWatcher
     50         # which is used in Python 3.8+. This is unix specific and also takes care about
     51         # cleaning up zombie processes. See https://bugs.python.org/issue35621
     52         if (
     53             sys.version_info[0] == 3
     54             and sys.version_info[1] == 7
     55             and sys.platform != "win32"
     56             and isinstance(asyncio.get_child_watcher(), asyncio.SafeChildWatcher)
     57         ):

Error: It looks like you are using Playwright Sync API inside the asyncio loop.
Please use the Async API instead.`

I've tried to install and uninstall playwright about 10 times, I've tried everything I found on the internet and nothing worked here, can someone please help me with this PLAGUE OF ERROR :@:@:@

i've tried a lot of things, i can't explain exactly what i try because i'm a little amateur, so, i don't know the process names of the things that i've tried

i have downloaded the file playwright-1.25.2-py3-none-win_amd64.whl and installed too, but the error persist.

the only one thing i've founded in this forum about my problem is this steps, but nothing works.

Run pip install -U pip Run pip uninstall plawyright Run pip cache remove playwright Run pip install playwright

0 Answers0