Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: how can i register the non-default browser with the webbrowsermodule?

Reply
Thread Tools

Re: how can i register the non-default browser with the webbrowsermodule?

 
 
Peter Otten
Guest
Posts: n/a
 
      09-05-2012
Levi Nie wrote:

> how can i register the non-default browser with the webbrowser module?
>
> the case:
> i want open a site such as "google.com" in ie8 with the python.But my
> default is chrome.
> so i want to register a ie8 controller with the
> webbrowser.register(*name*, *constructor*[, *instance*]).
> so what does the parameter "constructor" "instance" mean?
> how can i do it?


Isn't there already a controller for ie8? I can't check, but you can list
the available browsers with

>>> import webbrowser
>>> list(webbrowser._browsers)

['x-www-browser', 'kfmclient', 'firefox', 'konqueror']

Then if you want to open a page with a specific browser just do

url = "http://www.python.org"
browser = "firefox"
webbrowser.get(browser).open(url)


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: how can i register the non-default browser with the webbrowsermodule? Mark Lawrence Python 0 09-05-2012 04:33 PM
Where can I get the values for Page.Request.Browser.Browser? Nathan Sokalski ASP .Net 4 07-08-2008 01:59 AM
Can a 7960 sip phone register to ccm v3? R Siffredi Cisco 1 04-08-2005 08:41 PM
CSA Agent can't register with MC Bill F Cisco 7 07-10-2004 08:34 AM



Advertisments