I am trying to use Playwright async APIs https://playwright.dev/python/docs/library
within a task.
This means (at least that's how I understand it), that I have to declare
@task()
async mytask (ctx):
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto("https://playwright.dev")
print(await page.title())
await browser.close()
but that does not seem to work, I get:
RuntimeWarning: coroutine 'mytask' was never awaited
executor.execute(*self.tasks)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
is this possible, or do I need to switch to synchronous playwright APIs
I am trying to use Playwright async APIs https://playwright.dev/python/docs/library
within a task.
This means (at least that's how I understand it), that I have to declare
but that does not seem to work, I get:
RuntimeWarning: coroutine 'mytask' was never awaited
executor.execute(*self.tasks)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
is this possible, or do I need to switch to synchronous playwright APIs