A headless browser is a web browser without a user interface. This is great if you want to start a web browser to do tasks, but you don’t want or need to see it.
You can use a GUI browser like Firefox or Chrome. Then set it to headless mode. In any case, the web driver needs to be installed.
The code below starts Firefox, but in headless mode. It can do anything Firefox can, but it wont be visible on the screen. The screenshot below outputs the html code of the web page, but that’s optional.
from selenium import webdriver