selenium close current tab python code example
Example 1: close tab selenium python
There's nothing easier and clearer than just running JavaScript.
Open new tab: driver.execute_script("window.open('');")
Example 2: selenium close current tab
driver.close();