I am using Selenium 3 with python. Currently it is possible to send a Chrome DevTools command using the execute_cdp_cmd binding:
from selenium import webdriver
driver = webdriver.Chrome()
response = driver.execute_cdp_cmd('Network.getAllCookies', {})
print(response)
Is it possible somehow to add a listener for a Network Event? Something like:
driver.execute_cdp_cmd('Network.enable')
driver.add_listener('Network.dataReceived', my_listener)
It should be natively supported in Selenium 4 (currently in alpha), but I would like to know if it is possible to make this work in Selenium 3.