1

I'm using python to display a web page with webbrowser like this:

url = "file://c/python27/debug.html"
webbrowser.open_new_tab(url)

The user then enters some values on the page and clicks submit. At that point I need my python script to do another function call. How do I know the user has clicked submit on the page that I displayed?

If not, is there a better way to display the html page so I CAN know that it was responded to with a callback or something?

Kevin K
  • 11
  • 4
  • 1
    You can't tell via `webbrowser`, that just opens a new window/tab. – jonrsharpe Oct 09 '15 at 14:54
  • I don't think there's any elegant or easy way of doing what you want. That method just launches the browser - it's not hooked into it in any way afterwards. You'll need to somehow have javascript on that page... since it's a local file, I figure you can just modify it to load whatever javascript you want. Alternatively, if the page won't be served locally, you might be able to install a browser plugin or something that injects the javascript code you want into the browser. Not sure how any javascript code would actually communicate anything back to your python script, though. – ArtOfWarfare Oct 09 '15 at 14:56

0 Answers0