How to lanch a webbrowser

E

export

Does anyone know
how to lanch a webbrowser ( from Python) without menu and toolbars?
Thanks for help
Lad
 
O

Ola Natvig

Does anyone know
how to lanch a webbrowser ( from Python) without menu and toolbars?
Thanks for help
Lad

You've got the webbrowser module which lauches the OS's standard browser

from webbrowser import get
get("www.example.org")

launches the webbrowser, but how to launch it without menu and toolbar I
don't know. You could launch a small HTML page containing a javascript
that launches your wanted page.
 
P

Peter Hansen

Does anyone know
how to lanch a webbrowser ( from Python) without menu and toolbars?

Someone will no doubt point you to the "smart questions" page
as a result of this.... if nothing else because you've provided
no information whatsoever about the platform you are running on.

The simple answer is that Python provides a variety of things,
such as COM/ActiveX (on Windows), os.system, os.popen* and spawn,
the subprocess module, os.startfile(), and others, as ways of
starting external applications.

You could also no doubt find ways to integrate a web browser
into a Python program, such as by using ActiveX to stick the
InternetExplorer application into a wxPython program

Provide some useful background on your situation and you
might get some useful answers.

(I note that Eric Raymond's catb.org site is offline at this
moment, so go to the following link to read the "smart
questions" page that somebody will doubtless point you to:
http://www.google.ca/search?q=cache...esr/faqs/smart-questions.html+smart+questions
)

-Peter
 
S

Steve Holden

Ola said:
You've got the webbrowser module which lauches the OS's standard browser

from webbrowser import get
get("www.example.org")

launches the webbrowser, but how to launch it without menu and toolbar I
don't know. You could launch a small HTML page containing a javascript
that launches your wanted page.
This would indeed be the best way. The page you launched should contain
a script that creates another window. Since this would be browser-based
javascript, it could specify the appropriate browser window attributes
(see, for example

http://www.javascripter.net/faq/openinga.htm

which shows you how to specify the appropriate window characteristics).

The onload attribute of the first page's body could then specify closing
the window you opened from Python.

You may find that this close operation generates a warning from the
browser about scripts doing naughty things, however.

regards
Steve
 
P

python

Steve said:
This would indeed be the best way. The page you launched should contain
a script that creates another window. Since this would be browser-based
javascript, it could specify the appropriate browser window attributes
(see, for example

http://www.javascripter.net/faq/openinga.htm

which shows you how to specify the appropriate window characteristics).

The onload attribute of the first page's body could then specify closing
the window you opened from Python.

You may find that this close operation generates a warning from the
browser about scripts doing naughty things, however.

regards
Steve

Thank you Steve for the http link( was good) and to you all others as
well who helped me.
Lad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top