[Tutor] opening a javascript window and reading its source

Chiar Nimeni cutkiller1234 at yahoo.com
Tue Nov 27 01:10:37 CET 2007


i basicly need python to open a certain javascript window ... then read it's source ... how do i do that?

-----------------------------
import urllib2
import cookielib

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

url = opener.open("The url that has a javascript window toggled on click")
js = opener.open('javascript:toggleBackpack(null,2190551);')  # opening the JS window
js2 = opener.open("javascript:toggleBackpack('orb',2190551);") # toggleing another section on the JS window
source = js2.read()
print source
       
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071126/1deba7e2/attachment.htm 


More information about the Tutor mailing list