Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-22-2023, 01:57 PM   #1
Registered: Jan 2022
Posts: 40

Rep: Reputation: 0
python selenium show only website (without bars)

Hi, I just want to show the browser window no menu bar, address bar, addons or bookmarks.
If I activate the "headless" option, nothing is displayed at all.
Is this a bug of the new presentation of firefox on linux?
If no, is there another way to display only the browser window?

from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options

options = Options()
# options.headless = True # make all invisible
# options.add_argument("--headless") # make all invisible
service = Service(executable_path="/geckodriver")

driver = webdriver.Firefox(service=service, options = options)

Old 04-23-2023, 07:18 AM   #2
Registered: Jan 2022
Posts: 40

Original Poster
Rep: Reputation: 0
I have tested a lot, the page is displayed only by option "--kiosk" then driver "set_window_size" in the normal size and without menu, navigation bars in the popup window.

The only problem is the previous switch to full screen and the subsequent normalization.

Does anyone know of another method for displaying firefox as a popup window without full screen?

# works
driver = webdriver.Firefox(service=Service(executable_path="/geckodriver"), options = options)
driver.set_window_size(1024, 768)

# don't works (it seems to work only with chromium, apparently)
Old 05-10-2023, 09:03 AM   #3
LQ Newbie
Registered: Apr 2023
Location: Haldwani, Uttarakhand
Posts: 6

Rep: Reputation: 0
Hello this is Gulshan Negi
Well, the headless choice in Selenium is intended to run Firefox or different programs in a headless mode, and that implies that the program window won't be shown by any means. You can use a different option known as "autoconfig" to display the browser window without menus, address bar, add-ons, or bookmarks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
In Selenium with python, after choosing drop down option page refresh but giving values of previous page project.linux.proj Programming 5 06-21-2019 11:23 AM
[SOLVED] Selenium with python, works via CLI, but not with cron iamtheliquor Linux - Software 2 09-05-2018 02:50 AM
[SOLVED] Python Selenium: Dealing with Active Directory Auth popup yakkmeister Linux - Security 3 11-29-2017 07:27 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration