juventusryp
V2EX  ›  问与答

求教下使用 playwright 时候,如何向 page.on 的回调方法中传入参数

  •  
  •   juventusryp · Jan 15, 2023 · 909 views
    This topic created in 1294 days ago, the information mentioned may be changed or developed.

    描述:

    • 正常情况下使用下面代码可以监听到页面的 response ,但是现在想向 on_response 中额外的传递一些参数,求教该如何解决?
    def on_response(res):
      if res.status === 200:
        ...
            
    page.on("response", on_response)
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2389 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 00:35 · PVG 08:35 · LAX 17:35 · JFK 20:35
    ♥ Do have faith in what you're doing.