I tried writing like this, however still the virtual browser opens.
from selenium import webdriver
option = webdriver.ChromeOptions()
option.headless = True
browser = webdriver.Chrome(options=option)
browser.get("https://www.youtube.com")
I have tried doing this with the Firefox browser as well, however with no success.