fate0 / pychrome

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

how can i get a response in a middle url? i have try some `Network.responseReceived` but it can not work. #30

Closed songyingxin closed 6 years ago

songyingxin commented 6 years ago

code:

    9 # register callback if you want
   10 def request_will_be_sent(**kwargs):
   11     with open("url.txt", 'a') as f:
   12     ¦   f.write(kwargs.get('request').get('url') + '\n')
   13 
   14 tab.Network.requestWillBeSent = request_will_be_sent
   15 
   16 def response_received(**kwargs):
   17     with open('1.txt', 'a') as f:
   18     ¦   f.write(json.dumps(kwargs))
   19 
   20 tab.Network.responseReceived = response_received

and the Network.responseReceived can't work, the output is:

No handlers could be found for logger "pychrome.tab"

hope for your answer