browser.get_tab

def get_tab(self, title: str = '', url: str = '') -> BrowserTab

Get tab by specified title and/or url.

Parameters:
title: str
   title string, target web page’s title, supporting wildcard.
url: str
   url string, target web page’s url, supporting wildcard.

Returns:
BrowserTab object, you can execute following operations in the browser tab: find_element, find_elements, close, refresh and so on.

Example:


from clicknium import clicknium as cc

browser = cc.chrome.browsers[0]
# by tile and url
browser.get_tab("bing", "https://cn.bing.com/")

# by title only
browser.get_tab("bing")

# by url only
browser.get_tab(url = "https://cn.bing.com/")

# by title with wildcard
browser.get_tab("bi*", "https://cn.bing.com/")
What are your feelings
Updated on 29 August 2023