Advertisement
metalx1000

Webkit - Get Source Code after JavaScript runs

Jul 29th, 2013
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import webkit, gtk
  4.  
  5. def get_source(webobj, frame):
  6.     print "loading..."
  7.     x = web.get_main_frame().get_data_source().get_data()
  8.     print x
  9.  
  10. win = gtk.Window()
  11.  
  12. web = webkit.WebView()
  13. web.open("http://filmsbykris.com")
  14. web.connect("load-finished", get_source)
  15.  
  16. win.add(web)
  17.  
  18. win.show_all()
  19.  
  20. gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement