Adding time delay to selenium
webdriver
is a module and there are some caveats if you want to "decorate" a module in Python:
I would instead subclass a driver and override the execute()
method, which is actually responsible for sending webdriver commands:
class MyChromeDriver(webdriver.Chrome): def execute(self, driver_command, params=None): # add a delay here return super(MyChromeDriver, self).execute(driver_command, params=params)