juventusryp
V2EX  ›  问与答

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

  •  
  •   juventusryp · Jan 15, 2023 · 1069 views
    This topic created in 1374 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   ·   Privacy   ·   Solana   ·   5338 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 08:36 · PVG 16:36 · LAX 01:36 · JFK 04:36
    ♥ Do have faith in what you're doing.