user1294395
user1294395

Reputation:

Is there a way to close a Web browser that is already opened in Python?

I am trying to make a program that will automatically close a web tab or the Web browser. :/

Upvotes: 0

Views: 5681

Answers (1)

Lostsoul
Lostsoul

Reputation: 25999

Depends on what you want but you can try to kill the process(assuming your running windows, here's a sample)

import os
os.system("taskkill /F /IM chrome.exe")

I have read that you maybe able to use browser.py or subproceses to do this also.

Upvotes: 2

Related Questions