python webbrowser close tab 1

python webbrowser close tab

#Only For Windows!
import os
os.system("taskkill /im chrome.exe /f")

Here is what the above code is Doing:
1. We are importing the webdriver from the selenium module.
2. We are creating an instance of the webdriver.
3. We are using the get method to navigate to a webpage.
4. We are using the find_element_by_name method to find the search box.
5. We are using the send_keys method to type in the search box.
6. We are using the find_element_by_name method to find the search button.
7. We are using the click method to click the search button.
8. We are using the quit method to close the browser.

Similar Posts