Selenium webdriver – timed out

I’m using the Selenium library with the chromedriver on windows. When I run the code through IDLE python, everything happens as expected.
But when I run the code through KODI, it shows ‘time out’ error.

The site where I retrieve information via Selenium is very slow and takes a long time to load the page.

How to fix this error in KODI?

Code:
15:10:30 T:14796   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'socket.timeout'>
                                            Error Contents: timed out
                                            Traceback (most recent call last):
                                              File "C:\Users\homePC\AppData\Roaming\Kodi\addons\plugin.video.rededecanais\addon.py", line 1517, in <module>
                                                listar_filmesR()
                                              File "C:\Users\homePC\AppData\Roaming\Kodi\addons\plugin.video.rededecanais\addon.py", line 98, in listar_filmesR
                                                driver.quit()
                                              File "C:\Users\homePC\AppData\Roaming\Kodi\addons\plugin.video.rededecanais\resources\​lib\selenium\webdriver\chrome\webdriver.py", line 90, in quit
                                                self.service.stop()
                                              File "C:\Users\homePC\AppData\Roaming\Kodi\addons\plugin.video.rededecanais\resources\​lib\selenium\webdriver\common\service.py", line 149, in stop
                                                self.send_remote_shutdown_command()
                                              File "C:\Users\homePC\AppData\Roaming\Kodi\addons\plugin.video.rededecanais\resources\​lib\selenium\webdriver\common\service.py", line 125, in send_remote_shutdown_command
                                                url_request.urlopen("%s/shutdown" % self.service_url)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 127, in urlopen
                                                return _opener.open(url, data, timeout)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 404, in open
                                                response = self._open(req, data)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 422, in _open
                                                '_open', req)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 382, in _call_chain
                                                result = func(*args)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 1214, in http_open
                                                return self.do_open(httplib.HTTPConnection, req)
                                              File "C:\Program Files\Kodi\system\python\Lib\urllib2.py", line 1187, in do_open
                                                r = h.getresponse(buffering=True)
                                              File "C:\Program Files\Kodi\system\python\Lib\httplib.py", line 1067, in getresponse
                                                response.begin()
                                              File "C:\Program Files\Kodi\system\python\Lib\httplib.py", line 409, in begin
                                                version, status, reason = self._read_status()
                                              File "C:\Program Files\Kodi\system\python\Lib\httplib.py", line 365, in _read_status
                                                line = self.fp.readline(_MAXLINE + 1)
                                              File "C:\Program Files\Kodi\system\python\Lib\socket.py", line 476, in readline
                                                data = self._sock.recv(self._rbufsize)
                                            timeout: timed out
                                            -->End of Python script error report<--