💭 The WebDriver class offers methods that enable users to obtain a browser object for web automation purposes.
clicknium.ie
: IE web driverclicknium.chrome
: Chrome web driverclicknium.chromecdp
: Chrome web driver with Chrome DevTools Protocol(CDP)clicknium.edge
: Edge web driverclicknium.edgecdp
: Edge web driver with Chrome DevTools Protocol(CDP)clicknium.firefox
: Firefox web driverclicknium.chromium()
: Chromium based web driver, such as “brave”, “vivaldi” and so on
“clicknium.chromecdp
” and “clicknium.edgecdp
” can run without browser automation extension and support headless mode.
1. Properties #
browsers
: List[Browser], return all open browsers by current browser type.extension
: WebExtension, return the web extenion by current browser type.
2. Methods #
- open: open browser with the specified url, return a BrowserTab object.
- attach: attach to an opened browser tab with the specified locator, return a BrowserTab object.
- attach_by_title_url: attach to an opened browser tab with the specified title and/or url, return a BrowserTab object.
3. Examples #
from clicknium import clicknium as cc
# install chrome extension to automate chrome browser
cc.chrome.extension.install()
# open chrome browser
cc.chrome.open("www.bing.com")
# open chrome browser via CDP
cc.chromecdp.open("www.bing.com")
# open chrome browser via CDP with headless mode
cc.chromecdp.open("www.bing.com", args=["--headless"])
# open chromium based browser
cc.chromium('vivaldi').open("https://www.bing.com", timeout = 10)
cc.chromium('brave').open("https://www.bing.com", timeout = 10)