我想使用Except TimeoutError来处理超时问题。但是脚本总是抛给我一个TimeoutError,而不是像我计划的那样打印消息。 下面是我的代码: try: print("The frame is detached.") print("The frame is not detached") 我
注意:我正在使用playwright-python,但是对于实现JS解决方案是开放的--考虑到它会工作的。模板(取自https://github.com/microsoft/playwright-python示例代码):
from playwright.sync_api import sync_playwright