标题: 报错:playwright._impl._api_types.Error: It looks like you are using P [打印本页] 作者: 惊雷无声 时间: 2024-9-19 16:47 标题: 报错:playwright._impl._api_types.Error: It looks like you are using P 问题描述
在正常利用playwright串行接口时报错:playwright._impl._api_types.Error: It looks like you are using Playwright Sync API inside the asyncio loop.
Please use the Async API instead.
我个人是在本身写一个用playwright实现的web agent项目(webarena)相关时,利用脚本运行同一个playwright环境,如果之前有超时错误没有退出环境,又启动了playwright环境,此时它会认为你是想要一次性启动多个欣赏器,所以会出现这个报错。原项目的代码比较复杂,就大抵复现一下这个错误记录一下。
复现