juventusryp
V2EX  ›  问与答

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

  •  
  •   juventusryp · Jan 15, 2023 · 924 views
    This topic created in 1305 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   ·   3099 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 12:51 · PVG 20:51 · LAX 05:51 · JFK 08:51
    ♥ Do have faith in what you're doing.