Python Forum

Full Version: How to open a new tab without focusing on it.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

i have a project where i want to copy multiple elements on a website and each time i copy it a new tab opens with a search for this product. Unfortunatly each time i excetue it my focus switches to the new tab and i have to reclick to my initial page. Is there a way to silently open a new tab without generating the focus to it. I tryed with autoritation as False but it did not change anything. The line of code i use to open is down below. Thanks so much in advance!

webbrowser.open(ulr)
Hey. Isn't there an option webbrowser.opentab(url) that will open it without focusing? Have you read the webbrowser documentation it has a lot of info