Skip to content

Instantly share code, notes, and snippets.

@dlai0001
dlai0001 / gist:5880241
Created June 27, 2013 20:44
Keep pinging current URL in another browser thread to keep a browser alive when you do something more expensive.
class BrowserStandBy(object):
"""
This class allows you to put a browser on stand by sending no-op commands to keep
a selenium session from timing out.
"""
def __init__(self, webdriver, max_time=WTF_TIMEOUT_MANAGER.EPIC, sleep=5):
"""
@param webdriver:Webdriver instance to keep alive.
"""