Hi Fatima, you can run headless browser using Python-Selenium with following lines of code:
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.keys import Keys
opts = Options()
opts.set_headless()
assert opts.headless # Operating in headless mode
browser = Firefox(executable_path=r"C:\Users\Anvi_R\Downloads\geckodriver-v0.24.0-win64\geckodriver.exe", options=opts)
browser.implicitly_wait(3)
browser.get('https://duckduckgo.com')
search_form = browser.find_element_by_id('search_form_input_homepage')
search_form.send_keys('real python')
search_form.submit()
results = browser.find_elements_by_id('links')
print(results[0].text)