LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-22-2023, 01:57 PM   #1
blumenwesen
Member
 
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?

Code:
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)

driver.get("https://duckduckgo.com")
 
Old 04-23-2023, 07:18 AM   #2
blumenwesen
Member
 
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?

Code:
# works
options.add_argument("--kiosk")
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)
options.add_argument("--content-shell-hide-toolbar")
options.add_argument("--top-controls-hide-threshold")
options.add_argument("--app-auto-launched")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument("--disable-infobars")
 
Old 05-10-2023, 09:03 AM   #3
gulshan212
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.
Thanks
 
  


Reply


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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