Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Calling JavaScript inside the webbrowser module

Reply
Thread Tools

Calling JavaScript inside the webbrowser module

 
 
Anders Gunnarsson
Guest
Posts: n/a
 
      10-30-2011
Hi!

Is there anyway to communicate with JavaScript inside a website opened via the webbrowser module?

| import webbrowser
| webbrowser.open('http://python.org')

Here I'd like to do something like webbrowser.call('alert(1)')
and I'd like to be able to call the python app from javascript too.

I've looked at pywebkitgtk, but it's messy running on win32.

 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      10-31-2011
On Sun, 30 Oct 2011 13:33:29 -0700 (PDT), Anders Gunnarsson
<(E-Mail Removed)> declaimed the following in
gmane.comp.python.general:

> Hi!
>
> Is there anyway to communicate with JavaScript inside a website opened via the webbrowser module?
>
> | import webbrowser
> | webbrowser.open('http://python.org')
>

The documentation for Python 2.5 doesn't indicate any such
standardized method. From what I can tell, the default behavior is to
invoke the system defined browser (which could be anything including a
text-only program for a console system).

There does appear to be a .get() method in which you can ask for a
specific browser type -- but you'd still have to handle the case of the
browser not being available...

After that, it would be dependent upon whatever API the browser
opens up to the outside world. For Firefox, that would be XPCOM:
https://developer.mozilla.org/en/XPCOM
--
Wulfraed Dennis Lee Bieber AF6VN
http://www.velocityreviews.com/forums/(E-Mail Removed) HTTP://wlfraed.home.netcom.com/

 
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
webbrowser module bug on os x? robin Python 0 05-25-2006 12:13 PM
module webbrowser - open link in same window - osx robin Python 0 05-18-2006 02:21 PM
webbrowser module + urls ending in .py = a security hole? Blair P. Houghton Python 19 02-02-2006 04:47 PM
Firefox bug in webbrowser module on Ubuntu?! SPE - Stani's Python Editor Python 5 01-22-2006 11:34 AM
[python] -- interesting use of the webbrowser module David Stockwell Python 0 06-10-2004 06:37 PM



Advertisments