2

So, with python i've seen that you can open a website using the code

import webbrowser
webbrowser.open("http://www.example.com", new=2)

but i really want to know how you could close the same specific tab using python. If you can help please do. Thank you.

Coder Cody
  • 95
  • 1
  • 10

2 Answers2

0

I don't think you can. You might wanna try Selenium though.

How to open and close a website using default browser with python

Nitin Pawar
  • 168
  • 1
  • 10
0

webbrowser module has no methods to close browser's tabs

alexei e
  • 56
  • 2