def get_current_url(): """ Get a current URL """ try: _webview_ready.wait(5) return gui.get_current_url() except NameError: raise Exception( "Create a web view window first, before invoking this function")
def get_current_url(): """ Get a current URL """ try: _webview_ready.wait(5) assert gui.is_running() return gui.get_current_url() except NameError: raise Exception("Create a web view window first, before invoking this function") except AssertionError: raise Exception("Cannot call function: the webview has been closed")
def get_current_url(uid='master'): """ Get a current URL :param uid: uid of the target instance """ try: _webview_ready.wait(5) return gui.get_current_url(uid) except NameError: raise Exception('Create a web view window first, before invoking this function') except KeyError: raise Exception('Cannot call function: No webview exists with uid: {}'.format(uid))
def get_current_url(uid='master'): """ Get the URL currently loaded in the target webview :param uid: uid of the target instance """ return gui.get_current_url(uid)