How to close web browser using python
There is no webbrowser.close, you can use these codes to close the task(in Windows OS):
First Import os package with
import os
then use system function to kill the task
os.system("taskkill /im firefox.exe /f")
os.system("taskkill /im chrome.exe /f")
Using Python to close Chrome Browser on Win7+
You should do these:
os.system("powershell.exe -command Stop-Process -Name 'chrome'")
os.system("taskkill /im chrome.exe /f")
Related Topics
How to Count Duplicate Rows in Pandas Dataframe
How to Extract Rar Files Inside Google Colab
In Python, How to Find the Vowels in a Word
Correctly Reading Text from Windows-1252(Cp1252) File in Python
How to Get Max() to Return Variable Names Instead of Values in Python
Render_Template in Python-Flask Is Not Working
Is There a Short-Hand for Nth Root of X in Python
Typeerror: Unsupported Operand Type(S) for ** or Pow(): 'List' and 'Int'
Pandas - Tokenizing Data Expected 1 Field Saw Multiple
Python Searching for Partial Matches in a List
Python - Split a List of Dicts into Individual Dicts
Split List into Lists Based on a Character Occurring Inside of an Element
Setting Matplotlib Colorbar Range
How to Get Max() to Return Variable Names Instead of Values in Python
Split String in a Spark Dataframe Column by Regular Expressions Capturing Groups
How to Serialize Sqlalchemy Result to Json
How to Insert a Checkbox in a Django Form
How to Show a Pandas Dataframe into a Existing Flask HTML Table