When you use Chrome, you can direct the chromedriver instance that will control Chrome to log more information than what is available through the logging package. This information includes commands sent to the browser and the responses it receives. Here is an example:
from selenium import webdriver driver = webdriver.Chrome(service_log_path="/tmp/log") driver.get("http://www.google.com") driver.find_element_by_css_selector("input") driver.quit()
The above code will print the log to /tmp/log . The part of the log corresponding to the call to find_element_... looks like this:
[2.389][INFO]: COMMAND FindElement { "sessionId": "b6707ee92a3261e1dc33a53514490663", "using": "css selector", "value": "input" } [2.389][INFO]: Waiting for pending navigations... [2.389][INFO]: Done waiting for pending navigations [2.398][INFO]: Waiting for pending navigations... [2.398][INFO]: Done waiting for pending navigations [2.398][INFO]: RESPONSE FindElement { "ELEMENT": "0.3367185448296368-1" }
As far as I know, commands and responses accurately represent what happens between the client and the server. I submitted bug reports and corrections for the Selenium project based on what I saw in these logs.
source share