fate0 / pychrome

A Python Package for the Google Chrome Dev Protocol [threading base]
Other
612 stars 112 forks source link

获取网络返回信息时报错 #55

Open FlowerOda opened 3 years ago

FlowerOda commented 3 years ago

def loadingFinished(**kwargs):
    print('req is ',kwargs.get('requestId'),kwargs)
    _response = tab.Network.getResponseBody(requestId=kwargs.get('requestId'))
    _response_content = _response.get('body')
    print(_response_content[:100])
tab.set_listener('Network.loadingFinished',loadingFinished)```

pychrome.exceptions.CallMethodException: calling method: Network.getResponseBody error: No resource with given identifier found
jsjs0827 commented 3 years ago

I encounter similar problem,when I use the Fetch.requestPaused,the kwargs["requestId"] return something like interception-job-39.0,not the actual requestId.How to fix it,how to get requestId when using the Fetch.requestPaused?