I have an python application that I would like to use to send some data to a web page. I am sending this data via url encoding to pass some variables to the page. While I can get the server side to process the data on the web page I'm sending data to, I can't get the javascript to execute. Here are the two things I have tried:
A)
Expand|Select|Wrap|Line Numbers
- import urllib
- # Send a 'GET' request to protoSender
- data = urllib.urlencode({'LEGACY_ID' : 'work', 'BU_SOURCE_INDICATOR' : etc....})
- f = urllib.urlopen("http://www.blackspyraldancer.com/cardinal/protoSender.php?%s" % data)
- s = f.read()
Expand|Select|Wrap|Line Numbers
- import webbrowser
- # open browser with url encoded
- webbrowser.open("http://localhost/protosender.php?LEGACY_ID=1111&BU_SOURCE_INDICATOR=9999&etc....", new=0)
The problem with A is that the client side javascript doesn't run (which is used to send some xmlRequestObjects). I realize this is because the browser isn't launched and therefore not available to run the javascript.
B opens a browser and runs the page correctly, but it won't open the site in the same browser window (despite what it's supposed to do). Because this application will be running many many times, I wouldn't be able to keep opening new browsers windows.
I would appreciate any help. Thank you.
Jason
-------------------------------------------------------------------
http://www.elefoo.com/
http://www.blackspyraldancer.com/